10 releases
0.2.6 | Sep 8, 2024 |
---|---|
0.2.5 | Jun 13, 2022 |
0.1.2 | Aug 27, 2021 |
#52 in No standard library
170KB
4K
SLoC
Department
A Rust library hosting a possible implementation of the proposed Storages API,
as well as several of the standard std
collections implemented with it.
Inspired by storage-poc, re-implemented and built upon to provide (hopefully) release-ready functionality.
Features
By default, all features are turned on - but they can be disabled if you only want specific storages and collections
std
: Whether to include std error support and other std-only featuresall_storages
: Enable all storage featuresinline
: Inline on-the-stack storagesheap
: Virtual heap-like storage, can be used on the stack or in a staticstatic
: Storages backed by static memory, stored in the binaryalloc
: Storages backed by a standard allocator. Requires thealloc
crate to be availablefallback
: Storage which attempts to store something in one, then falls back to a second storagedebug
: Storage which wraps another, and provides a number of runtime checks which panic on certain forms of UB or incorrect usages.
all_collections
: Enable all collection typesbox
: Include theBox
typerc
: Include theRc
andWeak
typesvec
: Include theVec
typestring
: Include theString
type, requiresvec
Future Work
In the future, more types of storages and collections need to be added, hopefully
up to std
parity. Tests should be added for all storage types, with coverage for most
edge cases (ZST, alignment requirements, etc).
Missing Collections
btree
, an implementation of aBTreeMap
andBTreeSet
hash
, an implementation of aHashMap
andHashSet
arc
, implementation for atomically ref-counted itemsos/path
, implementations ofOsString
andPathBuf
Dependencies
~145KB