pub struct CallNode { /* private fields */ }
Expand description
A Call node describes a function call such that the callee is executed in a different execution context from the currently executing code.
A call node can be of two types:
- A simple call: the callee is executed in the new user context.
- A syscall: the callee is executed in the root context.
Implementations§
Source§impl CallNode
Constants
impl CallNode
Constants
Sourcepub const CALL_DOMAIN: Felt
pub const CALL_DOMAIN: Felt
The domain of the call block (used for control block hashing).
Sourcepub const SYSCALL_DOMAIN: Felt
pub const SYSCALL_DOMAIN: Felt
The domain of the syscall block (used for control block hashing).
Source§impl CallNode
Constructors
impl CallNode
Constructors
Sourcepub fn new(
callee: MastNodeId,
mast_forest: &MastForest,
) -> Result<Self, MastForestError>
pub fn new( callee: MastNodeId, mast_forest: &MastForest, ) -> Result<Self, MastForestError>
Returns a new CallNode
instantiated with the specified callee.
Sourcepub fn new_unsafe(callee: MastNodeId, digest: Word) -> Self
pub fn new_unsafe(callee: MastNodeId, digest: Word) -> Self
Returns a new CallNode
from values that are assumed to be correct.
Should only be used when the source of the inputs is trusted (e.g. deserialization).
Sourcepub fn new_syscall(
callee: MastNodeId,
mast_forest: &MastForest,
) -> Result<Self, MastForestError>
pub fn new_syscall( callee: MastNodeId, mast_forest: &MastForest, ) -> Result<Self, MastForestError>
Returns a new CallNode
instantiated with the specified callee and marked as a kernel
call.
Sourcepub fn new_syscall_unsafe(callee: MastNodeId, digest: Word) -> Self
pub fn new_syscall_unsafe(callee: MastNodeId, digest: Word) -> Self
Returns a new syscall CallNode
from values that are assumed to be correct.
Should only be used when the source of the inputs is trusted (e.g. deserialization).
Trait Implementations§
Source§impl MastNodeErrorContext for CallNode
impl MastNodeErrorContext for CallNode
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 CallNode
impl MastNodeExt for CallNode
Source§fn digest(&self) -> Word
fn digest(&self) -> Word
Returns a commitment to this Call node.
The commitment is computed as a hash of the callee and an empty word ([ZERO; 4]) in the domain defined by either Self::CALL_DOMAIN or Self::SYSCALL_DOMAIN, depending on whether the node represents a simple call or a syscall - i.e.,:
Hasher::merge_in_domain(&[callee_digest, Word::default()], CallNode::CALL_DOMAIN);
or
Hasher::merge_in_domain(&[callee_digest, Word::default()], CallNode::SYSCALL_DOMAIN);
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
.