pub struct Content { /* private fields */ }Expand description
Full-text index over file contents.
Implementations§
Source§impl Content
impl Content
Sourcepub fn open(
path: &Path,
extensions: Vec<String>,
limits: Limits,
) -> Result<Self, Error>
pub fn open( path: &Path, extensions: Vec<String>, limits: Limits, ) -> Result<Self, Error>
Open, creating the schema if needed.
§Errors
Error::Open if the database cannot be opened or the schema cannot
be created.
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
Whether the index has reached its configured size ceiling.
The write-ahead log is counted because it is real space the index is using; ignoring it lets the database sit well over its cap between checkpoints.
Sourcepub fn accepts(&self, path: &Path) -> bool
pub fn accepts(&self, path: &Path) -> bool
Whether this path is a candidate for content indexing.
Sourcepub fn index(&mut self, paths: &[PathBuf]) -> usize
pub fn index(&mut self, paths: &[PathBuf]) -> usize
Index paths, skipping anything unchanged since last time.
Returns how many documents were newly extracted. Callers run this off the interactive path.
Sourcepub fn prune_missing(&mut self)
pub fn prune_missing(&mut self)
Drop documents whose files no longer exist.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Content
impl !RefUnwindSafe for Content
impl !Sync for Content
impl !UnwindSafe for Content
impl Forget for Content
impl Move for Content
impl Send for Content
impl Unpin for Content
impl UnsafeUnpin for Content
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