Trait scrypto_test::prelude::KernelNodeApi
source · 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§
sourcefn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>
fn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>
Pin a node to it’s current device.
sourcefn kernel_allocate_node_id(
&mut self,
entity_type: EntityType
) -> Result<NodeId, RuntimeError>
fn kernel_allocate_node_id( &mut self, entity_type: EntityType ) -> Result<NodeId, RuntimeError>
Allocates a new node id useable for create_node
sourcefn kernel_create_node(
&mut self,
node_id: NodeId,
node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>
) -> Result<(), RuntimeError>
fn kernel_create_node( &mut self, node_id: NodeId, node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>> ) -> Result<(), RuntimeError>
Creates a new RENode
fn kernel_create_node_from( &mut self, node_id: NodeId, partitions: BTreeMap<PartitionNumber, (NodeId, PartitionNumber)> ) -> Result<(), RuntimeError>
sourcefn kernel_drop_node(
&mut self,
node_id: &NodeId
) -> Result<DroppedNode, RuntimeError>
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”.