Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/environ/src/prelude.rs
1692 views
1
//! Rust module prelude for Wasmtime crates.
2
//!
3
//! Wasmtime crates that use `no_std` use `core::prelude::*` by default which
4
//! does not include `alloc`-related functionality such as `String` and `Vec`.
5
//! To have similar ergonomics to `std` and additionally group up some common
6
//! functionality this module is intended to be imported at the top of all
7
//! modules with:
8
//!
9
//! ```rust,ignore
10
//! use crate::*;
11
//! ```
12
//!
13
//! Externally for crates that depend on `wasmtime-environ` they should have this
14
//! in the root of the crate:
15
//!
16
//! ```rust,ignore
17
//! use wasmtime_environ::prelude;
18
//! ```
19
//!
20
//! and then `use crate::*` works as usual.
21
22
pub use alloc::borrow::ToOwned;
23
pub use alloc::boxed::Box;
24
pub use alloc::format;
25
pub use alloc::string::{String, ToString};
26
pub use alloc::vec;
27
pub use alloc::vec::Vec;
28
pub use wasmparser::collections::{IndexMap, IndexSet};
29
30