Expand description
§Storage API
Note: This crate currently requires using nightly by default, unless you make default-features = false
, this is so Box
can support T: ?Sized
This is an implementation of the Storage
API, a better version of the Allocator
API, and data structures made for them including
Box
Vec
String
§How is it better than Allocator
?
Storage
s have an associated Handle
type so allocations dont need to be represented by a pointer, which allows Storage
s to allocate from a buffer they store inline
Instead of having Vec
and ArrayVec
as 2 seperate data structures they can be merged together, only using different Storage
s
Modules§
- collections
- The collections that use a
Storage
for their backing data - storages
- The types that implement
Storage
Structs§
- Box
- A type that owns a single
T
allocated in aStorage
- Global
- This represents the global allocator registered with the
#[global_allocator]
attribute - Inline
Storage - Represents an inline storage with the size/alignment requirements of
T
, thisStorage
type being possible of the main reasons for theStorage
API existing - Slot
Storage - Represents a buffer of bytes that can be allocated from
- Storage
Alloc Error - The error returned when allocating using a
Storage
fails - String
- A wrapper around
Vec<u8, S>
that is guarenteed to be valid UTF-8 so it can be referenced as astr
- Vec
- A collection for managing a list of elements
Traits§
- Multiple
Storage - A marker trait related to
Storage
that guarentees that multiple allocations can be made from aStorage
without invalidating old ones - Storage
- The trait for allocating memory in a storage
- Storage
Handle - The trait that all
Storage::Handle
s must implement