Expand description
Low-level allocation and OOM-handling utilities.
Structs§
- Vec
- Like
std::vec::Vecbut all methods that allocate force handling allocation failure.
Enums§
- Boxed
Slice From Fallible Iter Error - An error returned by
new_boxed_slice_from_fallible_iter. - TooFew
Items OrOom - An error returned by
new_boxed_slice_from_iter.
Traits§
- Panic
OnOom - An extension trait for ignoring
OutOfMemoryerrors. - 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>.
Functions§
- boxed_
slice_ write_ iter - Initialize a
Box<[MaybeUninit<T>]>slice by writing the elements of the given iterator into it. - new_
boxed_ slice_ from_ fallible_ iter - Create a
Box<[T]>from the given iterator’sResult<T, E>items. - new_
boxed_ slice_ from_ iter - Create a
Box<[T]>from the given iterator’s elements. - new_
boxed_ slice_ from_ iter_ with_ len - Create a
Box<[T]>of lengthlenfrom the given iterator’s elements. - new_
uninit_ boxed_ slice - Allocate a new
Box<[MaybeUninit<T>]>of the given length with uninitialized contents, returningErr(OutOfMemory)on allocation failure. - try_new
- Helper function to invoke
<T as TryNew>::try_new.