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
BoxVecString
§How is it better than Allocator?
Storages have an associated Handle type so allocations dont need to be represented by a pointer, which allows Storages 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 Storages
Modules§
- collections
- The collections that use a
Storagefor their backing data - storages
- The types that implement
Storage
Structs§
- Box
- A type that owns a single
Tallocated 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, thisStoragetype being possible of the main reasons for theStorageAPI existing - Slot
Storage - Represents a buffer of bytes that can be allocated from
- Storage
Alloc Error - The error returned when allocating using a
Storagefails - 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
Storagethat guarentees that multiple allocations can be made from aStoragewithout invalidating old ones - Storage
- The trait for allocating memory in a storage
- Storage
Handle - The trait that all
Storage::Handles must implement