Expand description
Fallible, OOM-handling collections.
Re-exports§
pub use btree_map::TryBTreeMap;
Modules§
Macros§
Structs§
- TryEntity
Set - Like
cranelift_entity::EntitySetbut enforces fallible allocation for all methods that allocate. - TryHash
Map - A wrapper type around [
hashbrown::hash_map::HashMap] that only exposes fallible allocation. - TryHash
Set - A wrapper type around [
hashbrown::hash_set::HashSet] that only exposes fallible allocation. - TryIndex
Map - A wrapper around [
indexmap::IndexMap] that only provides fallible allocation. - TryPrimary
Map - Like
cranelift_entity::PrimaryMapbut enforces fallible allocation for all methods that allocate. - TrySecondary
Map - Like
cranelift_entity::SecondaryMapbut all allocation is fallible. - TryString
- A newtype wrapper around
std::string::Stringthat only exposes fallible-allocation methods. - TryVec
- Like
std::vec::Vecbut all methods that allocate force handling allocation failure.
Enums§
- TryCow
- Like
std::borrow::Cowbut returnsOutOfMemoryerrors 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
Iteratorto fallibly collect into a container. - TryExtend
- Analogue of
Extendexcept handles OOM conditions. - TryFrom
Iterator - Analogue of
FromIteratorin the standard library, but used withTryCollect::try_collectinstead. - TryNew
- Extension trait providing fallible allocation for types like
Arc<T>andBox<T>. - TryTo
Owned - Like
std::borrow::ToOwnedbut returns anOutOfMemoryerror on allocation failure.
Functions§
- try_new
- Helper function to invoke
<T as TryNew>::try_new.