pub struct JoinNode { /* private fields */ }
Expand description
A Join node describe sequential execution. When the VM encounters a Join node, it executes the first child first and the second child second.
Implementations§
Source§impl JoinNode
Constructors
impl JoinNode
Constructors
Sourcepub fn new(
children: [MastNodeId; 2],
mast_forest: &MastForest,
) -> Result<Self, MastForestError>
pub fn new( children: [MastNodeId; 2], mast_forest: &MastForest, ) -> Result<Self, MastForestError>
Returns a new JoinNode
instantiated with the specified children nodes.
Sourcepub fn new_unsafe(children: [MastNodeId; 2], digest: Word) -> Self
pub fn new_unsafe(children: [MastNodeId; 2], digest: Word) -> Self
Returns a new JoinNode
from values that are assumed to be correct.
Should only be used when the source of the inputs is trusted (e.g. deserialization).
Source§impl JoinNode
Public accessors
impl JoinNode
Public accessors
Sourcepub fn digest(&self) -> Word
pub fn digest(&self) -> Word
Returns a commitment to this Join node.
The commitment is computed as a hash of the first
and second
child node in the domain
defined by Self::DOMAIN - i.e.,:
Hasher::merge_in_domain(&[first_child_digest, second_child_digest], JoinNode::DOMAIN);
Sourcepub fn first(&self) -> MastNodeId
pub fn first(&self) -> MastNodeId
Returns the ID of the node that is to be executed first.
Sourcepub fn second(&self) -> MastNodeId
pub fn second(&self) -> MastNodeId
Returns the ID of the node that is to be executed after the execution of the program defined by the first node completes.
Sourcepub fn before_enter(&self) -> &[DecoratorId]
pub fn before_enter(&self) -> &[DecoratorId]
Returns the decorators to be executed before this node is executed.
Sourcepub fn after_exit(&self) -> &[DecoratorId]
pub fn after_exit(&self) -> &[DecoratorId]
Returns the decorators to be executed after this node is executed.
Source§impl JoinNode
Mutators
impl JoinNode
Mutators
pub fn remap_children(&self, remapping: &Remapping) -> Self
Sourcepub fn append_before_enter(&mut self, decorator_ids: &[DecoratorId])
pub fn append_before_enter(&mut self, decorator_ids: &[DecoratorId])
Sets the list of decorators to be executed before this node.
Sourcepub fn append_after_exit(&mut self, decorator_ids: &[DecoratorId])
pub fn append_after_exit(&mut self, decorator_ids: &[DecoratorId])
Sets the list of decorators to be executed after this node.
Sourcepub fn remove_decorators(&mut self)
pub fn remove_decorators(&mut self)
Removes all decorators from this node.
Trait Implementations§
Source§impl MastNodeExt for JoinNode
impl MastNodeExt for JoinNode
Source§fn decorators(&self) -> impl Iterator<Item = (usize, DecoratorId)>
fn decorators(&self) -> impl Iterator<Item = (usize, DecoratorId)>
Source§fn get_assembly_op<'m>(
&self,
mast_forest: &'m MastForest,
target_op_idx: Option<usize>,
) -> Option<&'m AssemblyOp>
fn get_assembly_op<'m>( &self, mast_forest: &'m MastForest, target_op_idx: Option<usize>, ) -> Option<&'m AssemblyOp>
AssemblyOp
associated with this node and operation (if provided), if any. Read more