Skip to main content

wasmtime_environ/
collections.rs

1//! Fallible, OOM-handling collections.
2
3mod entity_set;
4mod hash_map;
5mod hash_set;
6mod index_map;
7mod primary_map;
8mod secondary_map;
9
10pub use entity_set::EntitySet;
11pub use hash_map::HashMap;
12pub use hash_set::HashSet;
13pub use index_map::IndexMap;
14pub use primary_map::PrimaryMap;
15pub use secondary_map::SecondaryMap;
16pub use wasmtime_core::{
17    alloc::{String, TryClone, TryCollect, TryExtend, TryFromIterator, TryNew, Vec, try_new},
18    vec,
19};
20
21/// Collections which abort on OOM.
22//
23// FIXME(#12069) this is just here for Wasmtime at this time. Ideally
24// collections would only be fallible in this module and would handle OOM. We're
25// in a bit of a transition period though.
26pub mod oom_abort {
27    #[cfg(not(feature = "std"))]
28    pub use hashbrown::{hash_map, hash_set};
29    #[cfg(feature = "std")]
30    pub use std::collections::{hash_map, hash_set};
31
32    pub use self::hash_map::HashMap;
33    pub use self::hash_set::HashSet;
34}