pub struct ExternalNode { /* private fields */ }
Expand description
Node for referencing procedures not present in a given MastForest
(hence “external”).
External nodes can be used to verify the integrity of a program’s hash while keeping parts of the program secret. They also allow a program to refer to a well-known procedure that was not compiled with the program (e.g. a procedure in the standard library).
The hash of an external node is the hash of the procedure it represents, such that an external node can be swapped with the actual subtree that it represents without changing the MAST root.
Implementations§
Source§impl ExternalNode
impl ExternalNode
Sourcepub fn new(procedure_hash: Word) -> Self
pub fn new(procedure_hash: Word) -> Self
Returns a new ExternalNode
instantiated with the specified procedure hash.
Source§impl ExternalNode
impl ExternalNode
Sourcepub fn digest(&self) -> Word
pub fn digest(&self) -> Word
Returns the commitment to the MAST node referenced by this external node.
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 ExternalNode
Mutators
impl ExternalNode
Mutators
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 Clone for ExternalNode
impl Clone for ExternalNode
Source§fn clone(&self) -> ExternalNode
fn clone(&self) -> ExternalNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExternalNode
impl Debug for ExternalNode
Source§impl MastNodeExt for ExternalNode
impl MastNodeExt for ExternalNode
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