pub struct SymbolTable { /* private fields */ }Expand description
Registry of named definitions in a query.
Stores the mapping from definition names to their AST expressions, along with source file information for diagnostics.
Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn new() -> Self
Sourcepub fn insert(&mut self, name: &str, source_id: SourceId, expr: Expr) -> bool
pub fn insert(&mut self, name: &str, source_id: SourceId, expr: Expr) -> bool
Insert a symbol definition.
Returns true if the symbol was newly inserted, false if it already existed
(in which case the old value is replaced).
Sourcepub fn source_id(&self, name: &str) -> Option<SourceId>
pub fn source_id(&self, name: &str) -> Option<SourceId>
Get the source file where a symbol is defined.
Sourcepub fn get_full(&self, name: &str) -> Option<(SourceId, &Expr)>
pub fn get_full(&self, name: &str) -> Option<(SourceId, &Expr)>
Get both the source ID and expression for a symbol.
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 · 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§fn default() -> SymbolTable
fn default() -> SymbolTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SymbolTable
impl !RefUnwindSafe for SymbolTable
impl !Send for SymbolTable
impl !Sync for SymbolTable
impl Unpin 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