pub struct PathIndex { /* private fields */ }Expand description
Index that maps file paths to code unit IDs.
Implementations§
Source§impl PathIndex
impl PathIndex
Sourcepub fn build(graph: &CodeGraph) -> Self
pub fn build(graph: &CodeGraph) -> Self
Build a PathIndex from all code units in the given graph.
Sourcepub fn lookup(&self, path: &Path) -> &[u64]
pub fn lookup(&self, path: &Path) -> &[u64]
Look up all unit IDs in the given file path.
Returns an empty slice if no units match.
Sourcepub fn paths(&self) -> &[PathBuf]
pub fn paths(&self) -> &[PathBuf]
Returns all distinct file paths present in the index, sorted.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Returns the number of distinct files in the index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathIndex
impl RefUnwindSafe for PathIndex
impl Send for PathIndex
impl Sync for PathIndex
impl Unpin for PathIndex
impl UnsafeUnpin for PathIndex
impl UnwindSafe for PathIndex
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