Trait KernelStackApi

Source
pub trait KernelStackApi {
    type CallFrameData;

    // Required methods
    fn kernel_get_stack_id(&mut self) -> Result<usize, RuntimeError>;
    fn kernel_switch_stack(&mut self, id: usize) -> Result<(), RuntimeError>;
    fn kernel_send_to_stack(
        &mut self,
        id: usize,
        value: &IndexedScryptoValue,
    ) -> Result<(), RuntimeError>;
    fn kernel_set_call_frame_data(
        &mut self,
        data: Self::CallFrameData,
    ) -> Result<(), RuntimeError>;
    fn kernel_get_owned_nodes(&mut self) -> Result<Vec<NodeId>, RuntimeError>;
}
Expand description

API for managing multiple call frame stacks

Required Associated Types§

Required Methods§

Source

fn kernel_get_stack_id(&mut self) -> Result<usize, RuntimeError>

Gets the stack id which is currently being used

Source

fn kernel_switch_stack(&mut self, id: usize) -> Result<(), RuntimeError>

Achieves a context switch by switching the underlying callframe/stack

Source

fn kernel_send_to_stack( &mut self, id: usize, value: &IndexedScryptoValue, ) -> Result<(), RuntimeError>

Moves the objects in a scrypto value from the current call frame to another stack

Source

fn kernel_set_call_frame_data( &mut self, data: Self::CallFrameData, ) -> Result<(), RuntimeError>

Sets the call frame data for the current call frame

Source

fn kernel_get_owned_nodes(&mut self) -> Result<Vec<NodeId>, RuntimeError>

Returns the owned nodes of the current call frame

Implementors§