pub struct MachGraph {
pub name: String,
pub index: u32,
pub root: Handle,
pub nodes: Vec<MachNode>,
}
Expand description
MachGraph. This is where nodes are organized.
Fields§
§name: String
Name of this graph.
index: u32
Optionally used index of this graph.
root: Handle
Root index of this graph.
nodes: Vec<MachNode>
Nodes in this graph.
Implementations§
Source§impl MachGraph
Implementation for MachGraph.
impl MachGraph
Implementation for MachGraph.
Sourcepub fn get_root_mut(&mut self) -> Option<&mut MachNode>
pub fn get_root_mut(&mut self) -> Option<&mut MachNode>
Get root node mutable reference.
Sourcepub fn get_node_mut(&mut self, handle: &Handle) -> Option<&mut MachNode>
pub fn get_node_mut(&mut self, handle: &Handle) -> Option<&mut MachNode>
Get node mutable reference.
Sourcepub fn get_parent(&self, handle: &Handle) -> Option<&MachNode>
pub fn get_parent(&self, handle: &Handle) -> Option<&MachNode>
Get parent.
Sourcepub fn push_component(&mut self, node: &Handle, component: u32)
pub fn push_component(&mut self, node: &Handle, component: u32)
Push a component to a node.
Sourcepub fn push_child(&mut self, name: &str) -> Handle
pub fn push_child(&mut self, name: &str) -> Handle
Push a child node of root with a name.
Sourcepub fn push_child_of(&mut self, name: &str, parent: &Handle) -> Handle
pub fn push_child_of(&mut self, name: &str, parent: &Handle) -> Handle
Push a new child node with a name and a parent.
Sourcepub fn push(&mut self, node: MachNode) -> u32
pub fn push(&mut self, node: MachNode) -> u32
Push a node to this graph. Sets index and returns it. Not used often…
Sourcepub fn visit_all_mut(&mut self, visitor: &mut impl Visitor)
pub fn visit_all_mut(&mut self, visitor: &mut impl Visitor)
Visit all nodes mutable (not in graph order).
Sourcepub fn pre_visit_mut(&mut self, visitor: &mut impl Visitor)
pub fn pre_visit_mut(&mut self, visitor: &mut impl Visitor)
Pre-visit mutable.
Sourcepub fn post_visit(&self, visitor: &impl Visitor)
pub fn post_visit(&self, visitor: &impl Visitor)
Post-visit.
Sourcepub fn post_visit_mut(&mut self, visitor: &mut impl Visitor)
pub fn post_visit_mut(&mut self, visitor: &mut impl Visitor)
Post-visit mutable.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MachGraph
impl<'de> Deserialize<'de> for MachGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MachGraph
impl RefUnwindSafe for MachGraph
impl Send for MachGraph
impl Sync for MachGraph
impl Unpin for MachGraph
impl UnwindSafe for MachGraph
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