pub struct SymbolIndex { /* private fields */ }Expand description
Index that maps symbol names to code unit IDs for O(1) lookup.
Implementations§
Source§impl SymbolIndex
impl SymbolIndex
Sourcepub fn build(graph: &CodeGraph) -> Self
pub fn build(graph: &CodeGraph) -> Self
Build a SymbolIndex from all code units in the given graph.
Iterates over every unit once, populating the exact, lowercase, and sorted name collections.
Sourcepub fn lookup_exact(&self, name: &str) -> &[u64]
pub fn lookup_exact(&self, name: &str) -> &[u64]
Look up unit IDs by exact symbol name (case-sensitive).
Returns an empty slice if no units match.
Sourcepub fn lookup_prefix(&self, prefix: &str) -> Vec<u64>
pub fn lookup_prefix(&self, prefix: &str) -> Vec<u64>
Look up unit IDs whose lowercase name starts with the given prefix (case-insensitive).
Uses binary search on sorted names for efficient prefix matching.
Sourcepub fn lookup_contains(&self, substring: &str) -> Vec<u64>
pub fn lookup_contains(&self, substring: &str) -> Vec<u64>
Look up unit IDs whose lowercase name contains the given substring (case-insensitive).
This is a linear scan over the lowercase map; use lookup_prefix or
lookup_exact when possible.
Trait Implementations§
Source§impl Clone for SymbolIndex
impl Clone for SymbolIndex
Source§fn clone(&self) -> SymbolIndex
fn clone(&self) -> SymbolIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SymbolIndex
impl Debug for SymbolIndex
Source§impl Default for SymbolIndex
impl Default for SymbolIndex
Source§fn default() -> SymbolIndex
fn default() -> SymbolIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SymbolIndex
impl RefUnwindSafe for SymbolIndex
impl Send for SymbolIndex
impl Sync for SymbolIndex
impl Unpin for SymbolIndex
impl UnsafeUnpin for SymbolIndex
impl UnwindSafe for SymbolIndex
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