pub struct ModuleTree { /* private fields */ }Implementations§
Source§impl ModuleTree
impl ModuleTree
Sourcepub fn get(&self, index: usize) -> ModuleNode<'_>
pub fn get(&self, index: usize) -> ModuleNode<'_>
Gets a borrowed handle to the node at index
Sourcepub fn get_mut(&mut self, index: usize) -> ModuleNodeMut<'_>
pub fn get_mut(&mut self, index: usize) -> ModuleNodeMut<'_>
Gets a mutable handle to the node at index
Sourcepub fn add_child(&mut self, parent: usize, name: Sym, is_ty: bool) -> usize
pub fn add_child(&mut self, parent: usize, name: Sym, is_ty: bool) -> usize
Creates a new child in this node
Sourcepub fn add_item(&mut self, node: usize, name: Sym, stack_index: usize)
pub fn add_item(&mut self, node: usize, name: Sym, stack_index: usize)
Binds a new item in this node
Sourcepub fn add_import(&mut self, parent: usize, name: Sym, child: usize)
pub fn add_import(&mut self, parent: usize, name: Sym, child: usize)
Creates an arbitrary child edge
Sourcepub fn add_items(&mut self, node: usize, binds: StackBinds)
pub fn add_items(&mut self, node: usize, binds: StackBinds)
Binds an entire stack frame in this node
Sourcepub fn add_imports(&mut self, node: usize, binds: HashMap<Sym, usize>)
pub fn add_imports(&mut self, node: usize, binds: HashMap<Sym, usize>)
Binds an arbitrary set of child edges
Sourcepub fn child(&self, node: usize, id: &Sym) -> Option<usize>
pub fn child(&self, node: usize, id: &Sym) -> Option<usize>
Gets the child of this node with the given name
Sourcepub fn item(&self, node: usize, name: &Sym) -> Option<usize>
pub fn item(&self, node: usize, name: &Sym) -> Option<usize>
Gets a stack value in this node with the given name
Sourcepub fn children(&self, node: usize) -> Option<&HashMap<Sym, usize>>
pub fn children(&self, node: usize) -> Option<&HashMap<Sym, usize>>
Returns a reference to this node’s children, if present
Sourcepub fn items(&self, node: usize) -> Option<&StackBinds>
pub fn items(&self, node: usize) -> Option<&StackBinds>
Returns a reference to this node’s items, if present
Trait Implementations§
Source§impl Clone for ModuleTree
impl Clone for ModuleTree
Source§fn clone(&self) -> ModuleTree
fn clone(&self) -> ModuleTree
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 ModuleTree
impl Debug for ModuleTree
Auto Trait Implementations§
impl Freeze for ModuleTree
impl RefUnwindSafe for ModuleTree
impl Send for ModuleTree
impl Sync for ModuleTree
impl Unpin for ModuleTree
impl UnwindSafe for ModuleTree
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