[][src]Trait sp_core::traits::CodeExecutor

pub trait CodeExecutor: Sized + Send + Sync + CallInWasm + Clone + 'static {
    type Error: Display + Debug + Send + 'static;
    fn call<R: Codec + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe>(
        &self,
        ext: &mut dyn Externalities,
        runtime_code: &RuntimeCode<'_>,
        method: &str,
        data: &[u8],
        use_native: bool,
        native_call: Option<NC>
    ) -> (Result<NativeOrEncoded<R>, Self::Error>, bool); }

Code execution engine.

Associated Types

type Error: Display + Debug + Send + 'static

Externalities error type.

Loading content...

Required methods

fn call<R: Codec + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe>(
    &self,
    ext: &mut dyn Externalities,
    runtime_code: &RuntimeCode<'_>,
    method: &str,
    data: &[u8],
    use_native: bool,
    native_call: Option<NC>
) -> (Result<NativeOrEncoded<R>, Self::Error>, bool)

Call a given method in the runtime. Returns a tuple of the result (either the output data or an execution error) together with a bool, which is true if native execution was used.

Loading content...

Implementors

Loading content...