Module prelude

Module prelude 

Source
Expand description

Rust module prelude for Wasmtime crates.

Wasmtime crates that use no_std use core::prelude::* by default which does not include alloc-related functionality such as String and Vec. To have similar ergonomics to std and additionally group up some common functionality this module is intended to be imported at the top of all modules with:

use crate::*;

Externally for crates that depend on wasmtime-environ they should have this in the root of the crate:

use wasmtime_environ::prelude;

and then use crate::* works as usual.

Modules§

vec
A contiguous growable array type with heap-allocated contents, written Vec<T>.

Macros§

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
bail
Return early with an error.
ensure
Return early with an error if a condition is not satisfied.
format
Creates a String using interpolation of runtime expressions.
vec
Creates a Vec containing the arguments.

Structs§

Box
A pointer type that uniquely owns a heap allocation of type T.
Error
The Error type, a wrapper around a dynamic error type.
IndexMap
A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
IndexSet
A default set of values.
String
A UTF-8–encoded, growable string.
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Traits§

Context
Provides the context method for Result.
ToOwned
A generalization of Clone to borrowed data.
ToString
A trait for converting a value to a String.

Type Aliases§

Result
Result<T, Error>