pub trait KernelNodeApi {
    // Required methods
    fn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>;
    fn kernel_allocate_node_id(
        &mut self,
        entity_type: EntityType
    ) -> Result<NodeId, RuntimeError>;
    fn kernel_create_node(
        &mut self,
        node_id: NodeId,
        node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>
    ) -> Result<(), RuntimeError>;
    fn kernel_create_node_from(
        &mut self,
        node_id: NodeId,
        partitions: BTreeMap<PartitionNumber, (NodeId, PartitionNumber)>
    ) -> Result<(), RuntimeError>;
    fn kernel_drop_node(
        &mut self,
        node_id: &NodeId
    ) -> Result<DroppedNode, RuntimeError>;
}
Expand description

API for managing nodes

Required Methods§

source

fn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>

Pin a node to it’s current device.

source

fn kernel_allocate_node_id( &mut self, entity_type: EntityType ) -> Result<NodeId, RuntimeError>

Allocates a new node id useable for create_node

source

fn kernel_create_node( &mut self, node_id: NodeId, node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>> ) -> Result<(), RuntimeError>

Creates a new RENode

source

fn kernel_create_node_from( &mut self, node_id: NodeId, partitions: BTreeMap<PartitionNumber, (NodeId, PartitionNumber)> ) -> Result<(), RuntimeError>

source

fn kernel_drop_node( &mut self, node_id: &NodeId ) -> Result<DroppedNode, RuntimeError>

Removes an RENode. Owned children will be possessed by the call frame.

Dropped substates can’t necessary be added back due to visibility loss. Clients should consider the return value as “raw data”.

Implementors§