2 unstable releases
0.2.0 | Feb 1, 2023 |
---|---|
0.1.0 | Jan 28, 2023 |
#15 in #unsized
6KB
83 lines
Sized
Sized is a Rust crate that provides support for using Dynamically Sized Types (DSTs) in a heapless environment. DSTs are a powerful feature of Rust programming language, but they require a heap for allocation, which is not available on some embedded systems. With "heapless-dst", you can take advantage of DSTs even on these resource-constrained systems, as it provides an implementation of DSTs without using the heap. The crate uses a pre-allocated buffer to store the data and provides a safe API for dynamic resizing and manipulation of the data, so you can use DSTs with confidence in your heapless system.
This crate currently require nightly rust with and the coerce_unsized
,
ptr_metadata
and unsize
feature. In addition of those, to make the
SizedBox::new
function const
, the features const_mut_refs
,
const_maybe_uninit_as_mut_ptr
, const_ptr_write
are required.
inline_const
is required to force a const context and verify the size at
compile time.