Trait SystemCallbackObject

Source
pub trait SystemCallbackObject: Sized {
    type Init: InitializationParameters<For = Self>;

    // Required methods
    fn init(init_input: Self::Init) -> Result<Self, BootloadingError>;
    fn invoke<Y: SystemApi<RuntimeError> + SystemBasedKernelInternalApi<SystemCallback = Self> + KernelNodeApi + KernelSubstateApi<SystemLockData>>(
        package_address: &PackageAddress,
        package_export: PackageExport,
        input: &IndexedScryptoValue,
        api: &mut Y,
    ) -> Result<IndexedScryptoValue, RuntimeError>;
}
Expand description

Callback object invoked by the system layer

Required Associated Types§

Source

type Init: InitializationParameters<For = Self>

Initialization Object

Required Methods§

Source

fn init(init_input: Self::Init) -> Result<Self, BootloadingError>

Initialize and create the callback object above the system

Source

fn invoke<Y: SystemApi<RuntimeError> + SystemBasedKernelInternalApi<SystemCallback = Self> + KernelNodeApi + KernelSubstateApi<SystemLockData>>( package_address: &PackageAddress, package_export: PackageExport, input: &IndexedScryptoValue, api: &mut Y, ) -> Result<IndexedScryptoValue, RuntimeError>

Invoke a function

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.

Implementors§

Source§

impl<'g, W: WasmEngine + 'g, E: NativeVmExtension> SystemCallbackObject for Vm<'g, W, E>

Source§

type Init = VmInit<'g, W, E>