pub struct Library {
pub home: PathBuf,
pub mode: LibraryMode,
pub db: IndexMap<Fp, Info, FxBuildHasher>,
pub paths: FxHashMap<PathBuf, Fp>,
pub reading_states: FxHashMap<Fp, ReaderInfo>,
pub modified_reading_states: FxHashSet<Fp>,
pub has_db_changed: bool,
pub fat32_epoch: SystemTime,
pub sort_method: SortMethod,
pub reverse_order: bool,
pub show_hidden: bool,
}Fields§
§home: PathBuf§mode: LibraryMode§db: IndexMap<Fp, Info, FxBuildHasher>§paths: FxHashMap<PathBuf, Fp>§reading_states: FxHashMap<Fp, ReaderInfo>§modified_reading_states: FxHashSet<Fp>§has_db_changed: bool§fat32_epoch: SystemTime§sort_method: SortMethod§reverse_order: boolImplementations§
Source§impl Library
impl Library
pub fn new<P: AsRef<Path>>(home: P, mode: LibraryMode) -> Result<Self, Error>
pub fn list<P: AsRef<Path>>( &self, prefix: P, query: Option<&BookQuery>, skip_files: bool, ) -> (Vec<Info>, BTreeSet<PathBuf>)
pub fn import(&mut self, settings: &ImportSettings)
pub fn add_document(&mut self, info: Info)
pub fn rename<P: AsRef<Path>>( &mut self, path: P, file_name: &str, ) -> Result<(), Error>
pub fn remove<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error>
pub fn copy_to<P: AsRef<Path>>( &mut self, path: P, other: &mut Library, ) -> Result<(), Error>
pub fn move_to<P: AsRef<Path>>( &mut self, path: P, other: &mut Library, ) -> Result<(), Error>
pub fn clean_up(&mut self)
pub fn sort(&mut self, sort_method: SortMethod, reverse_order: bool)
pub fn apply<F>(&mut self, f: F)
pub fn sync_reader_info<P: AsRef<Path>>(&mut self, path: P, reader: &ReaderInfo)
pub fn thumbnail_preview<P: AsRef<Path>>(&self, path: P) -> PathBuf
pub fn set_status<P: AsRef<Path>>(&mut self, path: P, status: SimpleStatus)
pub fn reload(&mut self)
pub fn flush(&mut self)
pub fn is_empty(&self) -> Option<bool>
fn reading_state_path(&self, fp: Fp) -> PathBuf
fn thumbnail_preview_path(&self, fp: Fp) -> PathBuf
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.