pub enum StackNode {
PopSymbol(SymbolPop),
PushSymbol(SymbolPush),
Root,
Scope(StackScope),
}Expand description
One node of a file’s stack graph: a step in the push/pop path name resolution walks to connect a reference to its definition.
Variants§
PopSymbol(SymbolPop)
Pops a symbol, ending the search if it is a definition.
PushSymbol(SymbolPush)
Pushes a symbol to be resolved against a later pop.
Root
The path’s starting point.
Scope(StackScope)
A lexical scope a path may enter while searching for a definition.
Implementations§
Source§impl StackNode
impl StackNode
Sourcepub fn symbol(&self) -> Option<&str>
pub fn symbol(&self) -> Option<&str>
The symbol this node pushes or pops, for symbol-carrying variants.
Sourcepub const fn precedence(&self) -> i64
pub const fn precedence(&self) -> i64
This node’s resolution precedence; 0 for variants without one.
Sourcepub const fn is_reference(&self) -> bool
pub const fn is_reference(&self) -> bool
Whether this node is a reference push (as opposed to an internal relay).
Sourcepub const fn is_definition(&self) -> bool
pub const fn is_definition(&self) -> bool
Whether this node pops a true definition (as opposed to a relay or a reference).
Sourcepub const fn import_binding(&self) -> Option<&ImportBinding>
pub const fn import_binding(&self) -> Option<&ImportBinding>
The import this definition binds, when it comes from an import.
Trait Implementations§
impl Eq for StackNode
impl StructuralPartialEq for StackNode
Auto Trait Implementations§
impl Forget for StackNode
impl Freeze for StackNode
impl RefUnwindSafe for StackNode
impl Send for StackNode
impl Sync for StackNode
impl Unpin for StackNode
impl UnsafeUnpin for StackNode
impl UnwindSafe for StackNode
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