pub struct ModuleNodeMut<'tree> { /* private fields */ }Expand description
Mutable object-oriented interface to a ModuleTree
Implementations§
Source§impl ModuleNodeMut<'_>
impl ModuleNodeMut<'_>
Sourcepub fn item(self, name: &Sym) -> Option<usize>
pub fn item(self, name: &Sym) -> Option<usize>
Gets a stack value in this node with the given name
Sourcepub fn children(&self) -> Option<&HashMap<Sym, usize>>
pub fn children(&self) -> Option<&HashMap<Sym, usize>>
Returns a reference to this node’s children, if present
Sourcepub fn items(&self) -> Option<&StackBinds>
pub fn items(&self) -> Option<&StackBinds>
Returns a reference to this node’s items, if present
Sourcepub fn find(self, path: &[PathPart]) -> (Self, &[PathPart])
pub fn find(self, path: &[PathPart]) -> (Self, &[PathPart])
Traverses a path starting at this node
Returns a new node, and the unconsumed path portion.
Sourcepub fn find_item(&self, path: &[PathPart]) -> Option<usize>
pub fn find_item(&self, path: &[PathPart]) -> Option<usize>
Traverses a path starting at this node
Returns an item address if the path terminated in an item.
Sourcepub fn add_import(&mut self, name: Sym, child: usize)
pub fn add_import(&mut self, name: Sym, child: usize)
Creates an arbitrary edge in the module graph
pub fn add_imports(&mut self, binds: HashMap<Sym, usize>)
Sourcepub fn add_items(&mut self, binds: StackBinds)
pub fn add_items(&mut self, binds: StackBinds)
Binds an entire stack frame in this node
Sourcepub fn as_ref(&self) -> ModuleNode<'_>
pub fn as_ref(&self) -> ModuleNode<'_>
Constructs a borrowing ModuleNode
Trait Implementations§
Auto Trait Implementations§
impl<'tree> Freeze for ModuleNodeMut<'tree>
impl<'tree> RefUnwindSafe for ModuleNodeMut<'tree>
impl<'tree> Send for ModuleNodeMut<'tree>
impl<'tree> Sync for ModuleNodeMut<'tree>
impl<'tree> Unpin for ModuleNodeMut<'tree>
impl<'tree> !UnwindSafe for ModuleNodeMut<'tree>
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