[−][src]Module holochain_wasmer_host::prelude
Re-exports
pub use crate::guest; |
pub use crate::instantiate::instantiate; |
pub use crate::instantiate::module; |
Modules
cache | The cache module provides the common data structures used by compiler backends to allow serializing compiled wasm code to a binary format. The binary format can be persisted, and loaded to allow skipping compilation and fast startup. |
error | The error module contains the data structures and helper functions used to implement errors that are produced and returned from the wasmer runtime. |
memory | The memory module contains the implementation data structures and helper functions used to manipulate and access wasm memory. |
result | |
types | Types used in the Wasm runtime and conversion functions. |
units | Various unit types. |
wasm | Various types exposed by the Wasmer Runtime. |
Macros
func | Helper macro to create a new |
holochain_serial | unidiomatic way to derive default trait implementations of TryFrom in/out of SerializedBytes |
imports | Generate an |
Structs
Array | The |
CodeVersion | A |
CompilerConfig | Configuration data for the compiler |
Ctx | The context of the currently running WebAssembly instance. |
DynFunc | A representation of an exported WebAssembly function. |
Features | Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal. |
Func | Represents a function that can be used by WebAssembly. |
Global | A handle to a Wasm Global |
ImportObject | All of the import data used when instantiating. |
ImportObjectIterator | Iterator for an |
Instance | An instantiated WebAssembly module. |
Item | The |
Memory | A shared or unshared wasm linear memory. |
MiddlewareChain | A container for a chain of middlewares. |
Module | A compiled WebAssembly module. |
Namespace | The top-level container for the two-level wasm imports |
SerializedBytes | A Canonical Serialized Bytes representation for data If you have a data structure that needs a canonical byte representation use this Always round-trip through SerializedBytes via. a single TryFrom implementation. This ensures that the internal bytes of SerializedBytes are indeed canonical. The corrolary is that if bytes are NOT wrapped in SerializedBytes we can assume they are NOT canonical. Typically we need a canonical serialization when data is to be handled at the byte level by independently implemented and maintained systems. |
StreamingCompiler | A streaming compiler which is designed to generated code for a module based on a stream of wasm parser events. |
Table | Container with a descriptor and a reference to a table storage. |
UnsafeBytes | UnsafeBytes the only way to implement a custom round trip through bytes for SerializedBytes It is intended to be an internal implementation in TryFrom implementations The assumption is that any code using UnsafeBytes is NOT valid messagepack data This allows us to enforce that all data round-tripping through SerializedBytes is via TryFrom and also allow for custom non-messagepack canonical representations of data types. |
WasmPtr | A zero-cost type that represents a pointer to something in Wasm linear memory. |
Enums
Backend | Enum used to select which compiler should be used to generate code. |
ExceptionCode | The code of an exception. |
Export | Kind of WebAssembly export. |
SerializedBytesError | |
Value | Represents a WebAssembly value. |
WasmError | Enum of all possible ERROR codes that a Zome API Function could return. |
WasmResult |
Constants
VERSION | The current version of this crate. |
Traits
Compiler | |
Deserialize | A data structure that can be deserialized from any data format supported by Serde. |
IsExport | A trait that represents |
LikeNamespace | This trait represents objects that act as a namespace for imports. For example, an |
Serialize | A data structure that can be serialized into any data format supported by Serde. |
TryFrom | Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of |
TryInto | An attempted conversion that consumes |
Functions
compile | Compile WebAssembly binary code into a |
compile_with | Compile a |
compile_with_config | The same as |
compile_with_config_with | The same as |
compiler_for_backend | Get the |
default_compiler | Get a single instance of the default compiler to use. |
instantiate | Compile and instantiate WebAssembly code without
creating a |
pop_code_version | Pops a |
push_code_version | Pushes a new |
validate | Perform validation as defined by the
WebAssembly specification. Returns |
Type Definitions
GuestPtr | a WasmSize integer that points to a position in wasm linear memory that the host and guest are sharing to communicate across function calls |
Len | a WasmSize integer that represents the size of bytes to read/write to memory in direct manipulations |
WasmSize | something like usize for wasm wasm has a memory limit of 4GB so offsets and lengths fit in u32 |
Derive Macros
Deserialize | |
Serialize | |
SerializedBytes |