pub struct Symbol {
pub name: String,
pub data: SymbolData,
pub type_id: TypeId,
}
Expand description
Represents a symbol in the symbol table
A symbol contains all the information needed to identify and work with a named entity in the language, including its name, specific data, and type.
Fields§
§name: String
The name of the symbol as it appears in source code
data: SymbolData
The specific data for this symbol kind
type_id: TypeId
The type ID associated with this symbol
Implementations§
Source§impl Symbol
impl Symbol
Sourcepub fn kind(&self) -> SymbolKind
pub fn kind(&self) -> SymbolKind
Returns the kind of this symbol for compatibility
Sourcepub fn is_mutable(&self) -> bool
pub fn is_mutable(&self) -> bool
Returns whether this symbol is mutable (only meaningful for variables)
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if this is a variable symbol
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this is a function symbol
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
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