Struct miden_core::mast::CallNode
source · 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
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
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_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.
source§impl CallNode
impl CallNode
Public accessors
sourcepub fn digest(&self) -> RpoDigest
pub fn digest(&self) -> RpoDigest
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, Digest::default()], CallNode::CALL_DOMAIN);
or
Hasher::merge_in_domain(&[callee_digest, Digest::default()], CallNode::SYSCALL_DOMAIN);
sourcepub fn callee(&self) -> MastNodeId
pub fn callee(&self) -> MastNodeId
Returns the ID of the node to be invoked by this call node.
sourcepub fn is_syscall(&self) -> bool
pub fn is_syscall(&self) -> bool
Returns true if this call node represents a syscall.
Trait Implementations§
impl Eq for CallNode
impl StructuralPartialEq for CallNode
Auto Trait Implementations§
impl Freeze for CallNode
impl RefUnwindSafe for CallNode
impl Send for CallNode
impl Sync for CallNode
impl Unpin for CallNode
impl UnwindSafe for CallNode
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)