Skip to main content

Module collections

Module collections 

Source
Expand description

Fallible, OOM-handling collections.

Re-exports§

pub use btree_map::TryBTreeMap;

Modules§

btree_map
OOM-handling TryBTreeMap implementation.
oom_abort
Collections which abort on OOM.

Macros§

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

Structs§

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

Enums§

TryCow
Like std::borrow::Cow but returns OutOfMemory errors for various APIs that force allocation of an owned copy.

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>.
TryToOwned
Like std::borrow::ToOwned but returns an OutOfMemory error on allocation failure.

Functions§

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