pub struct FsStore { /* private fields */ }Expand description
Filesystem-shaped Store implementation rooted at <root>.
Implementations§
Source§impl FsStore
impl FsStore
Sourcepub fn new(root: Utf8PathBuf) -> Result<Self, StoreError>
pub fn new(root: Utf8PathBuf) -> Result<Self, StoreError>
Open or create a store at root.
Creates <root>/ and <root>/.metadata/ if missing. On POSIX, both
directories are created with mode 0700 (owner-only). On Windows,
directory ACLs are inherited (no-op).
§Errors
Returns StoreError::Io if root exists but is not a directory,
or if directory creation fails.
Trait Implementations§
Source§impl Store for FsStore
impl Store for FsStore
Source§fn search(
&self,
query: &str,
limit: usize,
) -> Result<Vec<EntryInfo>, StoreError>
fn search( &self, query: &str, limit: usize, ) -> Result<Vec<EntryInfo>, StoreError>
Phase 1 search is a linear scan over all metadata files. Phase 2 will add a tantivy / sqlite-fts index when the corpus grows past the point where O(N) per query becomes noticeable in CLI latency.
Source§fn read(&self, key: &Safekey) -> Result<Option<Metadata>, StoreError>
fn read(&self, key: &Safekey) -> Result<Option<Metadata>, StoreError>
Read the entry keyed by
key. Read moreSource§fn write(
&self,
key: &Safekey,
m: &Metadata,
pdf: Option<&Utf8Path>,
) -> Result<(), StoreError>
fn write( &self, key: &Safekey, m: &Metadata, pdf: Option<&Utf8Path>, ) -> Result<(), StoreError>
Write or update the entry keyed by
key. Read moreSource§fn list_recent(&self, limit: usize) -> Result<Vec<EntryInfo>, StoreError>
fn list_recent(&self, limit: usize) -> Result<Vec<EntryInfo>, StoreError>
Return up to
limit entries, most-recent first by [doiget].fetched_at.Auto Trait Implementations§
impl Freeze for FsStore
impl RefUnwindSafe for FsStore
impl Send for FsStore
impl Sync for FsStore
impl Unpin for FsStore
impl UnsafeUnpin for FsStore
impl UnwindSafe for FsStore
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