pub struct IndexStore { /* private fields */ }Expand description
Index lifecycle orchestrator backed by a [SnapshotStore] for atomic
persistence and StoreMeta for corpus configuration.
Implementations§
Source§impl IndexStore
impl IndexStore
Sourcepub fn open_or_create(
sift_dir: &Path,
root: &Path,
corpus_kind: CorpusKind,
follow_links: bool,
indexes: &[IndexKind],
) -> Result<Self>
pub fn open_or_create( sift_dir: &Path, root: &Path, corpus_kind: CorpusKind, follow_links: bool, indexes: &[IndexKind], ) -> Result<Self>
Open an existing store or create a new one at sift_dir.
§Errors
Returns an error if the store directory cannot be created or metadata cannot be written.
pub fn current_id(&self) -> Option<&str>
pub fn snapshot_dir(&self, id: &str) -> PathBuf
Sourcepub fn build(
&mut self,
kinds: &[IndexKind],
config: &IndexConfig<'_>,
) -> Result<String>
pub fn build( &mut self, kinds: &[IndexKind], config: &IndexConfig<'_>, ) -> Result<String>
Build a new snapshot using the given index kinds.
Returns the snapshot id.
§Errors
Returns an error if the index build fails, the manifest cannot be written, or snapshot commit fails.
Sourcepub fn update(
&mut self,
kinds: &[IndexKind],
config: &IndexConfig<'_>,
) -> Result<Option<String>>
pub fn update( &mut self, kinds: &[IndexKind], config: &IndexConfig<'_>, ) -> Result<Option<String>>
Update the current snapshot, rebuilding only indexes whose corpus changed.
Returns the snapshot id if a new snapshot was published, or None if
no index changed.
§Errors
Returns an error if the current snapshot cannot be opened, the update check fails, or publishing the new snapshot fails.
Auto Trait Implementations§
impl Freeze for IndexStore
impl RefUnwindSafe for IndexStore
impl Send for IndexStore
impl Sync for IndexStore
impl Unpin for IndexStore
impl UnsafeUnpin for IndexStore
impl UnwindSafe for IndexStore
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more