pub struct Index<'a> { /* private fields */ }Expand description
Structure of our index.
Implementations§
Source§impl Index<'_>
impl Index<'_>
pub fn new(algo: ScoringAlgo, content: &str, path: Option<PathBuf>) -> Index<'_>
pub fn create_index(&mut self, opts: &IndexingOptions)
pub fn normalize(str: String, opts: &IndexingOptions) -> String
pub fn process_line(&mut self, n: LineNumber, opts: &IndexingOptions)
pub fn get_index_content(&self) -> &SerializedContent
Sourcepub fn get_match_count(
&self,
n: &LineNumber,
opts: &PresentationOptions,
) -> usize
pub fn get_match_count( &self, n: &LineNumber, opts: &PresentationOptions, ) -> usize
Return the number of matches for a given line
pub fn get_matches( &self, n: &LineNumber, opts: &PresentationOptions, ) -> Option<Vec<LineNumber>>
pub fn get_lines(&self) -> &Vec<&str>
pub fn get_hash(&self) -> &str
pub fn save(&self) -> Result<PathBuf>
pub fn load(&mut self) -> Option<()>
Sourcepub fn load_or_create_index(&mut self, opts: &IndexingOptions)
pub fn load_or_create_index(&mut self, opts: &IndexingOptions)
This function tried loading the index from file. If that fails for any reason, a new index will be created.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Index<'a>
impl<'a> RefUnwindSafe for Index<'a>
impl<'a> Send for Index<'a>
impl<'a> Sync for Index<'a>
impl<'a> Unpin for Index<'a>
impl<'a> UnwindSafe for Index<'a>
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