pub trait KernelInternalApi {
type System: KernelCallbackObject;
// Required methods
fn kernel_get_system_state(&mut self) -> SystemState<'_, Self::System>;
fn kernel_get_current_stack_depth_uncosted(&self) -> usize;
fn kernel_get_current_stack_id_uncosted(&self) -> usize;
fn kernel_get_node_visibility_uncosted(
&self,
node_id: &NodeId,
) -> NodeVisibility;
fn kernel_read_substate_uncosted(
&self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey,
) -> Option<&IndexedScryptoValue>;
// Provided method
fn kernel_get_system(&mut self) -> &mut Self::System { ... }
}
Expand description
Internal API for system modules only.
TODO: Do not use uncosted API within protocol The uncosted APIs should be used by non-consensus related system modules only, i.e. kernel trace and execution trace. All other usages should be migrated away, ideally as a whole.
Required Associated Types§
Required Methods§
Sourcefn kernel_get_system_state(&mut self) -> SystemState<'_, Self::System>
fn kernel_get_system_state(&mut self) -> SystemState<'_, Self::System>
Returns the system state.
Sourcefn kernel_get_current_stack_depth_uncosted(&self) -> usize
fn kernel_get_current_stack_depth_uncosted(&self) -> usize
Returns the current stack depth.
Used by kernel trace, execution trace and costing system modules only.
Sourcefn kernel_get_current_stack_id_uncosted(&self) -> usize
fn kernel_get_current_stack_id_uncosted(&self) -> usize
Returns the current stack id.
Used by kernel trace, execution trace, costing system modules and start_lock_fee
system function only.
Sourcefn kernel_get_node_visibility_uncosted(
&self,
node_id: &NodeId,
) -> NodeVisibility
fn kernel_get_node_visibility_uncosted( &self, node_id: &NodeId, ) -> NodeVisibility
Returns the visibility of a node.
Used by auth system module and actor_get_node_id
system function only.
Sourcefn kernel_read_substate_uncosted(
&self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey,
) -> Option<&IndexedScryptoValue>
fn kernel_read_substate_uncosted( &self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey, ) -> Option<&IndexedScryptoValue>
Returns the value of a substate.
Used by execution trace system module only.
Provided Methods§
Sourcefn kernel_get_system(&mut self) -> &mut Self::System
fn kernel_get_system(&mut self) -> &mut Self::System
Returns the system.