pub struct SymbolTable {
pub symbols: BTreeMap<SymbolId, SymbolInfo>,
pub dependencies: BTreeMap<SymbolId, BTreeSet<SymbolId>>,
/* private fields */
}Expand description
Symbol table for efficient lookups and validation
Fields§
§symbols: BTreeMap<SymbolId, SymbolInfo>Map from SymbolId to symbol information
dependencies: BTreeMap<SymbolId, BTreeSet<SymbolId>>Dependencies between symbols
Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn new() -> Self
Sourcepub fn register(&mut self, symbol: SymbolInfo)
pub fn register(&mut self, symbol: SymbolInfo)
Register a new symbol in the table
Sourcepub fn get(&self, id: &SymbolId) -> Option<&SymbolInfo>
pub fn get(&self, id: &SymbolId) -> Option<&SymbolInfo>
Lookup symbol by ID
Sourcepub fn get_by_path(&self, path: &[String]) -> Option<&SymbolInfo>
pub fn get_by_path(&self, path: &[String]) -> Option<&SymbolInfo>
Lookup symbol by name path
Sourcepub fn get_by_kind<'a>(
&'a self,
kind: &'a SymbolKind,
) -> impl Iterator<Item = &'a SymbolInfo> + 'a
pub fn get_by_kind<'a>( &'a self, kind: &'a SymbolKind, ) -> impl Iterator<Item = &'a SymbolInfo> + 'a
Get all symbols of a specific kind
Sourcepub fn add_dependency(&mut self, dependent: SymbolId, dependency: SymbolId)
pub fn add_dependency(&mut self, dependent: SymbolId, dependency: SymbolId)
Add dependency relationship
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SymbolTable
impl Debug for SymbolTable
Source§impl Default for SymbolTable
impl Default for SymbolTable
Source§impl PartialEq for SymbolTable
impl PartialEq for SymbolTable
Source§fn eq(&self, other: &SymbolTable) -> bool
fn eq(&self, other: &SymbolTable) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SymbolTable
impl StructuralPartialEq for SymbolTable
Auto Trait Implementations§
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin for SymbolTable
impl UnsafeUnpin for SymbolTable
impl UnwindSafe for SymbolTable
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