pub struct PathFSTIndex { /* private fields */ }Expand description
FST-based path index for fast path prefix queries and globbing
Implementations§
Source§impl PathFSTIndex
impl PathFSTIndex
Sourcepub fn build_from_paths<P: AsRef<Path>>(
paths: HashMap<PathBuf, u32>,
output_path: P,
) -> Result<Self>
pub fn build_from_paths<P: AsRef<Path>>( paths: HashMap<PathBuf, u32>, output_path: P, ) -> Result<Self>
Build FST index from path->handle mappings
Sourcepub fn load_from_file<P: AsRef<Path>>(fst_path: P, json_path: P) -> Result<Self>
pub fn load_from_file<P: AsRef<Path>>(fst_path: P, json_path: P) -> Result<Self>
Load existing FST index from file
Sourcepub fn save_reverse_mapping<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_reverse_mapping<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save reverse mapping to JSON file
Sourcepub fn get_handle(&self, path: &Path) -> Option<u32>
pub fn get_handle(&self, path: &Path) -> Option<u32>
Get file handle for exact path
Sourcepub fn find_by_prefix(&self, prefix: &str) -> Vec<(PathBuf, u32)>
pub fn find_by_prefix(&self, prefix: &str) -> Vec<(PathBuf, u32)>
Find all paths matching a prefix
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathFSTIndex
impl RefUnwindSafe for PathFSTIndex
impl Send for PathFSTIndex
impl Sync for PathFSTIndex
impl Unpin for PathFSTIndex
impl UnwindSafe for PathFSTIndex
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