pub enum MastNodeBuilder {
BasicBlock(BasicBlockNodeBuilder),
Call(CallNodeBuilder),
Dyn(DynNodeBuilder),
External(ExternalNodeBuilder),
Join(JoinNodeBuilder),
Loop(LoopNodeBuilder),
Split(SplitNodeBuilder),
}Expand description
Enum of all MAST node builders that can be added to a forest. This allows for generic handling of different builder types through enum dispatch.
Variants§
BasicBlock(BasicBlockNodeBuilder)
Call(CallNodeBuilder)
Dyn(DynNodeBuilder)
External(ExternalNodeBuilder)
Join(JoinNodeBuilder)
Loop(LoopNodeBuilder)
Split(SplitNodeBuilder)
Implementations§
Source§impl MastNodeBuilder
impl MastNodeBuilder
Sourcepub fn build(
self,
mast_forest: &MastForest,
) -> Result<MastNode, MastForestError>
pub fn build( self, mast_forest: &MastForest, ) -> Result<MastNode, MastForestError>
Build the node from this builder.
For nodes that depend on a MastForest (Call, Join, Loop, Split), the forest is required. For nodes that don’t depend on a MastForest (BasicBlock, Dyn, External), the forest is ignored.
Trait Implementations§
Source§impl Debug for MastNodeBuilder
impl Debug for MastNodeBuilder
Source§impl MastForestContributor for MastNodeBuilder
impl MastForestContributor for MastNodeBuilder
fn add_to_forest( self, forest: &mut MastForest, ) -> Result<MastNodeId, MastForestError>
Source§fn fingerprint_for_node(
&self,
forest: &MastForest,
hash_by_node_id: &impl LookupByIdx<MastNodeId, MastNodeFingerprint>,
) -> Result<MastNodeFingerprint, MastForestError>
fn fingerprint_for_node( &self, forest: &MastForest, hash_by_node_id: &impl LookupByIdx<MastNodeId, MastNodeFingerprint>, ) -> Result<MastNodeFingerprint, MastForestError>
Returns the fingerprint for this builder without constructing a MastNode. Read more
Source§fn remap_children(
self,
remapping: &impl LookupByIdx<MastNodeId, MastNodeId>,
) -> Self
fn remap_children( self, remapping: &impl LookupByIdx<MastNodeId, MastNodeId>, ) -> Self
Remap the node children to their new positions indicated by the given
lookup.
Source§fn with_before_enter(self, decorators: impl Into<Vec<DecoratorId>>) -> Self
fn with_before_enter(self, decorators: impl Into<Vec<DecoratorId>>) -> Self
Adds decorators to be executed before this node.
Source§fn with_after_exit(self, decorators: impl Into<Vec<DecoratorId>>) -> Self
fn with_after_exit(self, decorators: impl Into<Vec<DecoratorId>>) -> Self
Adds decorators to be executed after this node.
Source§fn append_before_enter(
&mut self,
decorators: impl IntoIterator<Item = DecoratorId>,
)
fn append_before_enter( &mut self, decorators: impl IntoIterator<Item = DecoratorId>, )
Appends decorators to be executed before this node. Read more
Source§fn append_after_exit(
&mut self,
decorators: impl IntoIterator<Item = DecoratorId>,
)
fn append_after_exit( &mut self, decorators: impl IntoIterator<Item = DecoratorId>, )
Appends decorators to be executed after this node. Read more
Source§fn with_digest(self, digest: Word) -> Self
fn with_digest(self, digest: Word) -> Self
Sets a digest to be forced into the built node. Read more
Auto Trait Implementations§
impl Freeze for MastNodeBuilder
impl RefUnwindSafe for MastNodeBuilder
impl Send for MastNodeBuilder
impl Sync for MastNodeBuilder
impl Unpin for MastNodeBuilder
impl UnwindSafe for MastNodeBuilder
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