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.
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 From<ExternalNode> for MastNode
impl From<ExternalNode> for MastNode
Source§fn from(v: ExternalNode) -> MastNode
fn from(v: ExternalNode) -> MastNode
Source§impl MastNodeErrorContext for ExternalNode
impl MastNodeErrorContext 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 moreSource§impl MastNodeExt for ExternalNode
impl MastNodeExt for ExternalNode
Source§fn digest(&self) -> Word
fn digest(&self) -> Word
Returns the commitment to the MAST node referenced by this external node.
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.
Source§fn before_enter(&self) -> &[DecoratorId]
fn before_enter(&self) -> &[DecoratorId]
Returns the decorators to be executed before this node is executed.
Source§fn after_exit(&self) -> &[DecoratorId]
fn after_exit(&self) -> &[DecoratorId]
Returns the decorators to be executed after this node is executed.
Source§fn append_before_enter(&mut self, decorator_ids: &[DecoratorId])
fn append_before_enter(&mut self, decorator_ids: &[DecoratorId])
Sets the list of decorators to be executed before this node.
Source§fn append_after_exit(&mut self, decorator_ids: &[DecoratorId])
fn append_after_exit(&mut self, decorator_ids: &[DecoratorId])
Sets the list of decorators to be executed after this node.
Source§fn remove_decorators(&mut self)
fn remove_decorators(&mut self)
Removes all decorators from this node.
Source§fn to_display<'a>(
&'a self,
mast_forest: &'a MastForest,
) -> Box<dyn Display + 'a>
fn to_display<'a>( &'a self, mast_forest: &'a MastForest, ) -> Box<dyn Display + 'a>
Source§fn to_pretty_print<'a>(
&'a self,
mast_forest: &'a MastForest,
) -> Box<dyn PrettyPrint + 'a>
fn to_pretty_print<'a>( &'a self, mast_forest: &'a MastForest, ) -> Box<dyn PrettyPrint + 'a>
Source§fn remap_children(&self, _remapping: &Remapping) -> Self
fn remap_children(&self, _remapping: &Remapping) -> Self
Remapping
.