Runtime

Trait Runtime 

Source
pub trait Runtime<Ext: BackendExternalities>:
    MemoryOwner
    + MemoryAccessRecorder
    + BackendState {
    type Error;

    // Required methods
    fn unreachable_error() -> Self::Error;
    fn ext_mut(&mut self) -> &mut Ext;
    fn run_any<T, F>(
        &mut self,
        gas: u64,
        cost: RuntimeCosts,
        f: F,
    ) -> Result<(u64, T), Self::Error>
       where F: FnOnce(&mut Self) -> Result<T, UndefinedTerminationReason>;
    fn run_fallible<T: Sized, F, R>(
        &mut self,
        gas: u64,
        res_ptr: u32,
        cost: RuntimeCosts,
        f: F,
    ) -> Result<(u64, ()), Self::Error>
       where F: FnOnce(&mut Self) -> Result<T, RunFallibleError>,
             R: From<Result<T, u32>> + Sized;
    fn alloc(&mut self, pages: u32) -> Result<WasmPage, Ext::AllocError>;
}

Required Associated Types§

Required Methods§

Source

fn unreachable_error() -> Self::Error

Source

fn ext_mut(&mut self) -> &mut Ext

Source

fn run_any<T, F>( &mut self, gas: u64, cost: RuntimeCosts, f: F, ) -> Result<(u64, T), Self::Error>
where F: FnOnce(&mut Self) -> Result<T, UndefinedTerminationReason>,

Source

fn run_fallible<T: Sized, F, R>( &mut self, gas: u64, res_ptr: u32, cost: RuntimeCosts, f: F, ) -> Result<(u64, ()), Self::Error>
where F: FnOnce(&mut Self) -> Result<T, RunFallibleError>, R: From<Result<T, u32>> + Sized,

Source

fn alloc(&mut self, pages: u32) -> Result<WasmPage, Ext::AllocError>

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§