Expand description
Generic traits for working with heap-allocated, allocator-aware and fixed-capacity collection types.
CollectionBase is the constructor-free root for sequences, sets, maps
and heaps. Collection and CollectionAlloc add constructors,
CollectionBytes provides byte lengths for byte buffers, and
CollectionCapacity provides fallible reservation and insertion.
CollectionSet and CollectionMap add set and map operations, while
CollectionEntry and MapEntry provide generic access to native map
entry APIs.
The traits themselves need neither alloc nor a global allocator. The
alloc feature (implied by the default std feature) adds the
implementations for the collections of the alloc crate, and the
heapless feature adds them for fixed-capacity collections which work on
targets without a heap.
Re-exports§
pub extern crate alloc;pub extern crate ascii;pub extern crate hashbrown;pub extern crate heapless;pub extern crate indexmap;
Macros§
- bmap
alloc - Creates an allocated
BTreeMapfrom key-value pairs. - bset
alloc - Creates an allocated
BTreeSetfrom values. - deque
alloc - Creates an allocated
VecDequefrom values, appending each value to the back of the deque. - heap
alloc - Creates an allocated
BinaryHeapfrom values. - list
alloc - Creates an allocated
LinkedListfrom values, appending each value to the end of the list. - map
allocandstd - Creates a
HashMapfrom key-value pairs. Available with thestdfeature. - s
alloc - Converts a string literal into an allocated
String. - set
allocandstd - Creates a
HashSetfrom values. Available with thestdfeature.
Structs§
- From
Slice Error - Error when slice size mismatches array length.
Traits§
- Byte
Array - Trait for fixed-size byte array types and wrappers around them.
- Collection
- Trait implemented by collections with a default constructor and iterator support.
- Collection
Alloc - Trait implemented by collections that support custom allocators.
- Collection
Base - Trait implemented by all collection types.
- Collection
Bytes - Trait for contiguous byte collections.
- Collection
Capacity - Trait implemented by collections that can reserve storage capacity.
- Collection
Entry - Trait implemented by maps that expose an in-place entry API.
- Collection
Map - Trait implemented by key-value maps.
- Collection
Set - Trait implemented by set collections.
- MapEntry
- Common interface over the native entry types of maps.