pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn new<P: AsRef<Path>>(path: P, pool_size: u32) -> Result<Self>
pub fn in_memory(pool_size: u32) -> Result<Self>
pub fn insert_file(&self, file: &FileEntry) -> Result<i64>
pub fn insert_files_batch(&self, files: &[FileEntry]) -> Result<()>
pub fn find_by_path(&self, path: &Path) -> Result<Option<FileEntry>>
pub fn find_by_id(&self, id: i64) -> Result<Option<FileEntry>>
pub fn delete_by_path(&self, path: &Path) -> Result<()>
pub fn search_by_name( &self, pattern: &str, limit: usize, ) -> Result<Vec<FileEntry>>
pub fn search_by_extension( &self, extension: &str, limit: usize, ) -> Result<Vec<FileEntry>>
pub fn get_all_files( &self, limit: usize, offset: usize, ) -> Result<Vec<FileEntry>>
pub fn insert_content( &self, file_id: i64, preview: &ContentPreview, ) -> Result<()>
pub fn insert_fts_entry( &self, file_id: i64, name: &str, path: &str, content: &str, ) -> Result<()>
pub fn search_content(&self, query: &str, limit: usize) -> Result<Vec<i64>>
pub fn add_exclusion_rule(&self, rule: &ExclusionRule) -> Result<i64>
pub fn get_exclusion_rules(&self) -> Result<Vec<ExclusionRule>>
pub fn log_access(&self, file_id: i64) -> Result<()>
pub fn get_stats(&self) -> Result<IndexStats>
pub fn clear_all(&self) -> Result<()>
pub fn vacuum(&self) -> Result<()>
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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