pub struct TrigramIndex { /* private fields */ }Expand description
Trigram index for fast regex preprocessing and filtering
Implementations§
Source§impl TrigramIndex
impl TrigramIndex
Sourcepub fn add_file_content(&mut self, file_handle: u32, content: &str)
pub fn add_file_content(&mut self, file_handle: u32, content: &str)
Add content from a file to the trigram index
Sourcepub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load trigram index from file
Sourcepub fn extract_regex_trigrams(&self, regex_pattern: &str) -> Result<Vec<String>>
pub fn extract_regex_trigrams(&self, regex_pattern: &str) -> Result<Vec<String>>
Extract trigrams from a regex pattern for fast filtering
Sourcepub fn get_regex_candidates(&self, regex_pattern: &str) -> Result<HashSet<u32>>
pub fn get_regex_candidates(&self, regex_pattern: &str) -> Result<HashSet<u32>>
Get candidate file handles that might match a regex based on trigrams
Sourcepub fn stats(&self) -> TrigramStats
pub fn stats(&self) -> TrigramStats
Get statistics about the trigram index
Trait Implementations§
Source§impl Debug for TrigramIndex
impl Debug for TrigramIndex
Source§impl<'de> Deserialize<'de> for TrigramIndex
impl<'de> Deserialize<'de> for TrigramIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TrigramIndex
impl RefUnwindSafe for TrigramIndex
impl Send for TrigramIndex
impl Sync for TrigramIndex
impl Unpin for TrigramIndex
impl UnwindSafe for TrigramIndex
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