Expand description
A crate that provides means of executing/dispatching calls into the runtime.
There are a few responsibilities of this crate at the moment:
- It provides an implementation of a common entrypoint for calling into the runtime, both wasm and compiled.
- It defines the environment for the wasm execution, namely the host functions that are to be provided into the wasm runtime module.
- It also provides the required infrastructure for executing the current wasm runtime (specified
by the current value of
:codein the provided externalities), i.e. interfacing with wasm engine used, instance cache.
Re-exports§
pub use self::wasmtime::InstantiationStrategy as WasmtimeInstantiationStrategy;pub use common::error;pub use common::wasm_runtime::HeapAllocStrategy;pub use common::wasm_runtime::DEFAULT_HEAP_ALLOC_PAGES;pub use common::wasm_runtime::DEFAULT_HEAP_ALLOC_STRATEGY;
Modules§
- common
- A set of common definitions that are needed for defining execution engines.
- polkavm
- wasmtime
- Defines a
WasmRuntimethat uses the Wasmtime JIT to execute.
Structs§
- Native
Else Wasm Executor Deprecated - A generic
CodeExecutorimplementation that uses a delegate to determine wasm code equivalence and dispatch to native code when possible, falling back onWasmExecutorwhen not. - Native
Version - The version of the native runtime.
- Runtime
Version - Runtime version.
This should not be thought of as classic Semver (major/minor/tiny).
This triplet have different semantics and mis-interpretation could cause problems.
In particular: bug fixes should result in an increment of
spec_versionand possiblyauthoring_version, absolutely notimpl_versionsince they change the semantics of the runtime. - Wasm
Executor - An abstraction over Wasm code executor. Supports selecting execution backend and manages runtime cache.
Enums§
- Wasm
Execution Method - Specification of different methods of executing the runtime Wasm code.
Traits§
- Codec
- Trait that allows zero-copy read/write of value-references to/from slices in LE format.
- Host
Functions - Something that provides implementations for host functions.
- Native
Execution Dispatch - Delegate for dispatching a CodeExecutor call.
- Runtime
Version Of - Extracts the runtime version of a given runtime code.
Functions§
- read_
embedded_ version - Take the runtime blob and scan it for the custom wasm sections containing the version
information and construct the
RuntimeVersionfrom them. - with_
externalities_ safe - Set up the externalities and safe calling environment to execute runtime calls.