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.
Sourcepub fn search_by_tag(
&self,
tag: &str,
query: &str,
limit: usize,
) -> Result<Vec<EntryInfo>, StoreError>
pub fn search_by_tag( &self, tag: &str, query: &str, limit: usize, ) -> Result<Vec<EntryInfo>, StoreError>
Return up to limit entries whose [doiget].tags list contains tag
(case-sensitive exact match). If query is non-empty, also apply a
case-insensitive substring filter over title / authors / venue /
publisher. An empty query matches all tagged entries.
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>
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>
key. Read moretags / collections or a None annotation means exactly that
(UserFields::Authored). doiget tag / doiget annotate only.Source§fn list_recent(&self, limit: usize) -> Result<Vec<EntryInfo>, StoreError>
fn list_recent(&self, limit: usize) -> Result<Vec<EntryInfo>, StoreError>
limit entries, most-recent first by [doiget].fetched_at.