commit | 6c02bf1e807648702e2ce0e8b1849b446e5d8bfe | [log] [tgz] |
---|---|---|
author | Pierre-Clément Tosi <ptosi@google.com> | Fri Nov 25 17:54:43 2022 +0000 |
committer | Pierre-Clément Tosi <ptosi@google.com> | Mon Nov 28 10:47:53 2022 +0000 |
tree | 01d087b988302c9f280f90279f524bcf7d7f0194 | |
parent | 7388ef014620436064aa9e87f50f2f6c5e153f5a [diff] |
Add 'no_std' variant of the crate Add a variant of the crate that can be used in no_std projects. Test: m pvmfw_img # with aosp/2318791 Change-Id: I7fafcb0c10be292d0e4e190aa97fd20813c81356
A 100% safe crate of vec-like types. #![forbid(unsafe_code)]
Main types are as follows:
ArrayVec
is an array-backed vec-like data structure. It panics on overflow.SliceVec
is the same deal, but using a &mut [T]
.TinyVec
(alloc
feature) is an enum that's either an Inline(ArrayVec)
or a Heap(Vec)
. If a TinyVec
is Inline
and would overflow it automatically transitions to Heap
and continues whatever it was doing.To attain this “100% safe code” status there is one compromise: the element type of the vecs must implement Default
.
For more details, please see the docs.rs documentation