Skip to main content

Module collections

Module collections 

Source
Expand description

Fallible, OOM-handling collections.

Modules§

oom_abort
Collections which abort on OOM.

Macros§

vec
Same as the std::vec! macro but returns an error on allocation failure.

Structs§

EntitySet
Like cranelift_entity::EntitySet but enforces fallible allocation for all methods that allocate.
HashMap
A wrapper type around [hashbrown::hash_map::HashMap] that only exposes fallible allocation.
HashSet
A wrapper type around [hashbrown::hash_set::HashSet] that only exposes fallible allocation.
IndexMap
A wrapper around [indexmap::IndexMap] that only provides fallible allocation.
PrimaryMap
Like cranelift_entity::PrimaryMap but enforces fallible allocation for all methods that allocate.
SecondaryMap
Like cranelift_entity::SecondaryMap but all allocation is fallible.
String
A newtype wrapper around std::string::String that only exposes fallible-allocation methods.
Vec
Like std::vec::Vec but all methods that allocate force handling allocation failure.

Traits§

TryClone
A trait for values that can be cloned, but contain owned, heap-allocated values whose allocations may fail during cloning.
TryCollect
Extension trait for an Iterator to fallibly collect into a container.
TryExtend
Analogue of Extend except handles OOM conditions.
TryFromIterator
Analogue of FromIterator in the standard library, but used with TryCollect::try_collect instead.
TryNew
Extension trait providing fallible allocation for types like Arc<T> and Box<T>.

Functions§

try_new
Helper function to invoke <T as TryNew>::try_new.