Struct System

Source
pub struct System<V: SystemCallbackObject> {
    pub versioned_system_logic: SystemVersion,
    pub callback: V,
    pub blueprint_cache: NonIterMap<CanonicalBlueprintId, Rc<BlueprintDefinition>>,
    pub schema_cache: NonIterMap<SchemaHash, Rc<VersionedScryptoSchema>>,
    pub auth_cache: NonIterMap<CanonicalBlueprintId, AuthConfig>,
    pub modules: SystemModuleMixer,
    pub finalization: SystemFinalization,
}

Fields§

§versioned_system_logic: SystemVersion§callback: V§blueprint_cache: NonIterMap<CanonicalBlueprintId, Rc<BlueprintDefinition>>§schema_cache: NonIterMap<SchemaHash, Rc<VersionedScryptoSchema>>§auth_cache: NonIterMap<CanonicalBlueprintId, AuthConfig>§modules: SystemModuleMixer§finalization: SystemFinalization

Implementations§

Source§

impl<V: SystemCallbackObject> System<V>

Source

pub fn new( versioned_system_logic: SystemVersion, callback: V, modules: SystemModuleMixer, finalization: SystemFinalization, ) -> Self

Trait Implementations§

Source§

impl<V: SystemCallbackObject> HasModules for System<V>

Source§

impl<V: SystemCallbackObject> KernelCallbackObject for System<V>

Source§

type LockData = SystemLockData

Data to be stored with each substate lock
Source§

type CallFrameData = Actor

Data to be stored with every call frame
Source§

fn on_pin_node<Y: KernelInternalApi<System = Self>>( node_id: &NodeId, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a node is pinned to the heap
Source§

fn on_create_node<Y: KernelInternalApi<System = Self>>( event: CreateNodeEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callbacks before/on-io-access/after a new node is created
Source§

fn on_drop_node<Y: KernelInternalApi<System = Self>>( event: DropNodeEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callbacks before/on-io-access/after a node is dropped
Source§

fn on_move_module<Y: KernelInternalApi<System = Self>>( event: MoveModuleEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback when a module is moved
Source§

fn on_open_substate<Y: KernelInternalApi<System = Self>>( event: OpenSubstateEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access/after a substate is opened
Source§

fn on_close_substate<Y: KernelInternalApi<System = Self>>( event: CloseSubstateEvent, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a substate is closed
Source§

fn on_read_substate<Y: KernelInternalApi<System = Self>>( event: ReadSubstateEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a substate is read
Source§

fn on_write_substate<Y: KernelInternalApi<System = Self>>( event: WriteSubstateEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a substate is written to
Source§

fn on_set_substate<Y: KernelInternalApi<System = Self>>( event: SetSubstateEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access a substate is set
Source§

fn on_remove_substate<Y: KernelInternalApi<System = Self>>( event: RemoveSubstateEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access a substate is removed
Source§

fn on_scan_keys<Y: KernelInternalApi<System = Self>>( event: ScanKeysEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access a key scan occurs
Source§

fn on_drain_substates<Y: KernelInternalApi<System = Self>>( event: DrainSubstatesEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access a substate drain occurs
Source§

fn on_scan_sorted_substates<Y: KernelInternalApi<System = Self>>( event: ScanSortedSubstatesEvent<'_>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before/on-io-access a sorted substate scan occurs
Source§

fn before_invoke<Y: KernelApi<CallbackObject = Self>>( invocation: &KernelInvocation<Actor>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before an invocation and a new call frame is created
Source§

fn on_execution_start<Y: KernelInternalApi<System = Self>>( api: &mut Y, ) -> Result<(), RuntimeError>

Callback after a new call frame is created for a new invocation
Source§

fn invoke_upstream<Y: KernelApi<CallbackObject = Self>>( input: &IndexedScryptoValue, api: &mut Y, ) -> Result<IndexedScryptoValue, RuntimeError>

Callback on invocation. This is where the callback object should execute application logic.
Source§

fn auto_drop<Y: KernelApi<CallbackObject = Self>>( nodes: Vec<NodeId>, api: &mut Y, ) -> Result<(), RuntimeError>

Callback after invocation during call frame cleanup and nodes are still owned by the executed call frame
Source§

fn on_execution_finish<Y: KernelInternalApi<System = Self>>( message: &CallFrameMessage, api: &mut Y, ) -> Result<(), RuntimeError>

Callback right after execution of invocation and where call of execution still exists
Source§

fn on_get_stack_id<Y: KernelInternalApi<System = Self>>( api: &mut Y, ) -> Result<(), RuntimeError>

Source§

fn on_switch_stack<Y: KernelInternalApi<System = Self>>( api: &mut Y, ) -> Result<(), RuntimeError>

Source§

fn on_send_to_stack<Y: KernelInternalApi<System = Self>>( value: &IndexedScryptoValue, api: &mut Y, ) -> Result<(), RuntimeError>

Source§

fn on_set_call_frame_data<Y: KernelInternalApi<System = Self>>( data: &Self::CallFrameData, api: &mut Y, ) -> Result<(), RuntimeError>

Source§

fn on_get_owned_nodes<Y: KernelInternalApi<System = Self>>( api: &mut Y, ) -> Result<(), RuntimeError>

Source§

fn after_invoke<Y: KernelApi<CallbackObject = Self>>( output: &IndexedScryptoValue, api: &mut Y, ) -> Result<(), RuntimeError>

Callback after an invocation and where invocation’s call frame has already been destroyed
Source§

fn on_allocate_node_id<Y: KernelInternalApi<System = Self>>( entity_type: EntityType, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before node id allocation
Source§

fn on_mark_substate_as_transient<Y: KernelInternalApi<System = Self>>( node_id: &NodeId, partition_number: &PartitionNumber, substate_key: &SubstateKey, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a substate is marked as transient
Source§

fn on_substate_lock_fault<Y: KernelApi<CallbackObject = Self>>( node_id: NodeId, partition_num: PartitionNumber, offset: &SubstateKey, api: &mut Y, ) -> Result<bool, RuntimeError>

Callback when a substate does not exist
Source§

fn on_drop_node_mut<Y: KernelApi<CallbackObject = Self>>( node_id: &NodeId, api: &mut Y, ) -> Result<(), RuntimeError>

Callback before a node is dropped
Source§

impl<V: SystemCallbackObject> KernelTransactionExecutor for System<V>

Source§

type Init = SystemInit<<V as SystemCallbackObject>::Init>

Initialization object
Source§

type Executable = ExecutableTransaction

The transaction object
Source§

type ExecutionOutput = Vec<InstructionOutput>

Output to be returned at the end of execution
Source§

type Receipt = TransactionReceipt

Final receipt to be created after transaction execution
Source§

fn init( store: &mut impl CommitableSubstateStore, executable: &ExecutableTransaction, init_input: Self::Init, always_visible_global_nodes: &'static IndexSet<NodeId>, ) -> Result<(Self, Vec<CallFrameInit<Actor>>), Self::Receipt>

Create the callback object (system layer) and the initial call frame configuration for each intent
Source§

fn execute<Y: SystemBasedKernelApi>( api: &mut Y, executable: &ExecutableTransaction, ) -> Result<Vec<InstructionOutput>, RuntimeError>

Start execution
Source§

fn finalize( &mut self, executable: &ExecutableTransaction, info: StoreCommitInfo, ) -> Result<(), RuntimeError>

Finish execution
Source§

fn create_receipt<S: SubstateDatabase>( self, track: Track<'_, S>, interpretation_result: Result<Vec<InstructionOutput>, TransactionExecutionError>, ) -> TransactionReceipt

Create final receipt

Auto Trait Implementations§

§

impl<V> Freeze for System<V>
where V: Freeze,

§

impl<V> !RefUnwindSafe for System<V>

§

impl<V> !Send for System<V>

§

impl<V> !Sync for System<V>

§

impl<V> Unpin for System<V>
where V: Unpin,

§

impl<V> !UnwindSafe for System<V>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> ContextualTryInto<U> for T
where U: ContextualTryFrom<T>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<X, Y> LabelledResolve<Y> for X
where Y: LabelledResolveFrom<X>,

Source§

fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<X, Y> Resolve<Y> for X
where Y: ResolveFrom<X>,

Source§

fn resolve(self) -> Y

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.