pub struct TypeIndex { /* private fields */ }Expand description
Index that groups code units by their type.
Implementations§
Source§impl TypeIndex
impl TypeIndex
Sourcepub fn build(graph: &CodeGraph) -> Self
pub fn build(graph: &CodeGraph) -> Self
Build a TypeIndex from all code units in the given graph.
Sourcepub fn lookup(&self, unit_type: CodeUnitType) -> &[u64]
pub fn lookup(&self, unit_type: CodeUnitType) -> &[u64]
Look up all unit IDs of the given type.
Returns an empty slice if no units match.
Sourcepub fn count(&self, unit_type: CodeUnitType) -> usize
pub fn count(&self, unit_type: CodeUnitType) -> usize
Returns the count of units of the given type.
Sourcepub fn types(&self) -> Vec<CodeUnitType>
pub fn types(&self) -> Vec<CodeUnitType>
Returns all code unit types present in the index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeIndex
impl RefUnwindSafe for TypeIndex
impl Send for TypeIndex
impl Sync for TypeIndex
impl Unpin for TypeIndex
impl UnsafeUnpin for TypeIndex
impl UnwindSafe for TypeIndex
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