| Crates.io | static-collections |
| lib.rs | static-collections |
| version | 0.2.1 |
| created_at | 2025-09-06 06:11:16.322619+00 |
| updated_at | 2025-12-14 13:35:06.038233+00 |
| description | Implementations of fixed-capacity collection types. |
| homepage | https://github.com/Zero-Tang/static-collections |
| repository | https://github.com/Zero-Tang/static-collections |
| max_upload_size | |
| id | 1826823 |
| size | 59,661 |
The static-collections crate aims to implement static collection types which do not require dynamic allocations.
It should be useful to create dynamic data structures on stack or global variables.
StaticString<N> typeThe StaticString<N> type can be used to put a dynamic-length string on stack and/or global variable with maximum size of N bytes.
StaticCString<N> typeThe StaticCString<N> type can be used to put a dynamic-length null-terminated string on stack and/or global variable with maximum size of N bytes.
StaticWString<N> typeThe StaticWString<N> type can be used to put a dynamic-length UTF-16-encoded string on stack and/or global variable with maximum size of N UTF-16 characters.
StaticVec<N,T> typeThe StaticVec<N,T> type can be used to put a dynamic-length array on stack and/or global variable with maximum size of N elements.
RefBitmap<N> typeThe RefBitmap<N> is a ZST type that can be used to reference a bitmap with N bits.
For x86 (including 32-bit and 64-bit) targets, bitmap operations are accelerated by special bit instructions (e.g.: bt instruction).
I am no algorithm-expert. Useful data-structures in alloc::collections (e.g.: BTreeMap) module will not be implemented here for now.
However, feel free to contribute.
This repository supports no_std and does not require dynamic allocations.
Hence, it could probably be useful for resource-limited environments (e.g.: embedded devices, windows-kernel with high IRQL, etc.)
This crate is licensed under the MIT license