pub trait KernelCallbackObject: Sized {
type LockData: Default + Clone;
type CallFrameData: CallFrameReferences;
Show 28 methods
// Required methods
fn on_pin_node<Y>(node_id: &NodeId, api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_create_node<Y>(
event: CreateNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_drop_node<Y>(
event: DropNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_move_module<Y>(
event: MoveModuleEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_open_substate<Y>(
event: OpenSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_close_substate<Y>(
event: CloseSubstateEvent,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_read_substate<Y>(
event: ReadSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_write_substate<Y>(
event: WriteSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_set_substate<Y>(
event: SetSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_remove_substate<Y>(
event: RemoveSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_scan_keys<Y>(
event: ScanKeysEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_drain_substates<Y>(
event: DrainSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_scan_sorted_substates<Y>(
event: ScanSortedSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn before_invoke<Y>(
invocation: &KernelInvocation<Self::CallFrameData>,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn on_execution_start<Y>(api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn invoke_upstream<Y>(
args: &IndexedScryptoValue,
api: &mut Y,
) -> Result<IndexedScryptoValue, RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn auto_drop<Y>(nodes: Vec<NodeId>, api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn on_execution_finish<Y>(
message: &CallFrameMessage,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn after_invoke<Y>(
output: &IndexedScryptoValue,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn on_allocate_node_id<Y>(
entity_type: EntityType,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_mark_substate_as_transient<Y>(
node_id: &NodeId,
partition_number: &PartitionNumber,
substate_key: &SubstateKey,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_substate_lock_fault<Y>(
node_id: NodeId,
partition_num: PartitionNumber,
offset: &SubstateKey,
api: &mut Y,
) -> Result<bool, RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn on_drop_node_mut<Y>(
node_id: &NodeId,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelApi<CallbackObject = Self>;
fn on_get_stack_id<Y>(api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_switch_stack<Y>(api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_send_to_stack<Y>(
value: &IndexedScryptoValue,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_set_call_frame_data<Y>(
data: &Self::CallFrameData,
api: &mut Y,
) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
fn on_get_owned_nodes<Y>(api: &mut Y) -> Result<(), RuntimeError>
where Y: KernelInternalApi<System = Self>;
}
Expand description
Upper layer callback object which a kernel interacts with during execution
Required Associated Types§
Sourcetype CallFrameData: CallFrameReferences
type CallFrameData: CallFrameReferences
Data to be stored with every call frame
Required Methods§
Sourcefn on_pin_node<Y>(node_id: &NodeId, api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_pin_node<Y>(node_id: &NodeId, api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before a node is pinned to the heap
Sourcefn on_create_node<Y>(
event: CreateNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_create_node<Y>(
event: CreateNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callbacks before/on-io-access/after a new node is created
Sourcefn on_drop_node<Y>(
event: DropNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_drop_node<Y>(
event: DropNodeEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callbacks before/on-io-access/after a node is dropped
Sourcefn on_move_module<Y>(
event: MoveModuleEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_move_module<Y>(
event: MoveModuleEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback when a module is moved
Sourcefn on_open_substate<Y>(
event: OpenSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_open_substate<Y>(
event: OpenSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access/after a substate is opened
Sourcefn on_close_substate<Y>(
event: CloseSubstateEvent,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_close_substate<Y>(
event: CloseSubstateEvent,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before a substate is closed
Sourcefn on_read_substate<Y>(
event: ReadSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_read_substate<Y>(
event: ReadSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before a substate is read
Sourcefn on_write_substate<Y>(
event: WriteSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_write_substate<Y>(
event: WriteSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before a substate is written to
Sourcefn on_set_substate<Y>(
event: SetSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_set_substate<Y>(
event: SetSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access a substate is set
Sourcefn on_remove_substate<Y>(
event: RemoveSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_remove_substate<Y>(
event: RemoveSubstateEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access a substate is removed
Sourcefn on_scan_keys<Y>(
event: ScanKeysEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_scan_keys<Y>(
event: ScanKeysEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access a key scan occurs
Sourcefn on_drain_substates<Y>(
event: DrainSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_drain_substates<Y>(
event: DrainSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access a substate drain occurs
Sourcefn on_scan_sorted_substates<Y>(
event: ScanSortedSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_scan_sorted_substates<Y>(
event: ScanSortedSubstatesEvent<'_>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before/on-io-access a sorted substate scan occurs
Sourcefn before_invoke<Y>(
invocation: &KernelInvocation<Self::CallFrameData>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn before_invoke<Y>(
invocation: &KernelInvocation<Self::CallFrameData>,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback before an invocation and a new call frame is created
Sourcefn on_execution_start<Y>(api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_execution_start<Y>(api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback after a new call frame is created for a new invocation
Sourcefn invoke_upstream<Y>(
args: &IndexedScryptoValue,
api: &mut Y,
) -> Result<IndexedScryptoValue, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn invoke_upstream<Y>(
args: &IndexedScryptoValue,
api: &mut Y,
) -> Result<IndexedScryptoValue, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback on invocation. This is where the callback object should execute application logic.
Sourcefn auto_drop<Y>(nodes: Vec<NodeId>, api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn auto_drop<Y>(nodes: Vec<NodeId>, api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback after invocation during call frame cleanup and nodes are still owned by the executed call frame
Sourcefn on_execution_finish<Y>(
message: &CallFrameMessage,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_execution_finish<Y>(
message: &CallFrameMessage,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback right after execution of invocation and where call of execution still exists
Sourcefn after_invoke<Y>(
output: &IndexedScryptoValue,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn after_invoke<Y>(
output: &IndexedScryptoValue,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback after an invocation and where invocation’s call frame has already been destroyed
Sourcefn on_allocate_node_id<Y>(
entity_type: EntityType,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_allocate_node_id<Y>(
entity_type: EntityType,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before node id allocation
Sourcefn on_mark_substate_as_transient<Y>(
node_id: &NodeId,
partition_number: &PartitionNumber,
substate_key: &SubstateKey,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_mark_substate_as_transient<Y>(
node_id: &NodeId,
partition_number: &PartitionNumber,
substate_key: &SubstateKey,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Callback before a substate is marked as transient
Sourcefn on_substate_lock_fault<Y>(
node_id: NodeId,
partition_num: PartitionNumber,
offset: &SubstateKey,
api: &mut Y,
) -> Result<bool, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn on_substate_lock_fault<Y>(
node_id: NodeId,
partition_num: PartitionNumber,
offset: &SubstateKey,
api: &mut Y,
) -> Result<bool, RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback when a substate does not exist
Sourcefn on_drop_node_mut<Y>(
node_id: &NodeId,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
fn on_drop_node_mut<Y>(
node_id: &NodeId,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelApi<CallbackObject = Self>,
Callback before a node is dropped
fn on_get_stack_id<Y>(api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_switch_stack<Y>(api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_send_to_stack<Y>(
value: &IndexedScryptoValue,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_set_call_frame_data<Y>(
data: &Self::CallFrameData,
api: &mut Y,
) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
fn on_get_owned_nodes<Y>(api: &mut Y) -> Result<(), RuntimeError>where
Y: KernelInternalApi<System = Self>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.