Skip to main content

wasmtime_environ/
prelude.rs

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
22pub use crate::collections::{
23    TryBTreeMap, TryClone, TryCollect, TryEntitySet, TryExtend, TryFromIterator, TryHashMap,
24    TryHashSet, TryIndexMap, TryNew, TryPrimaryMap, TrySecondaryMap, TryString, TryToOwned, TryVec,
25    try_new, try_vec,
26};
27pub use crate::error::{Context, Error, Result, bail, ensure, format_err};
28pub use alloc::borrow::ToOwned;
29pub use alloc::boxed::Box;
30pub use alloc::format;
31pub use alloc::string::{String, ToString};
32pub use alloc::vec;
33pub use alloc::vec::Vec;
34pub use wasmparser::collections::{IndexMap, IndexSet};