#vec #no-std #no_std

no-std tinyvec

tinyvec provides 100% safe vec-like data structures

21 releases (2 stable)

new 1.1.0-alpha.1 Oct 14, 2020
1.0.0 Aug 28, 2020
0.4.1 Jul 24, 2020
0.3.4 Aug 17, 2020
0.3.3 Mar 26, 2020

#3 in #vec

Download history 116290/week @ 2020-06-30 111702/week @ 2020-07-07 91993/week @ 2020-07-14 115313/week @ 2020-07-21 123713/week @ 2020-07-28 126777/week @ 2020-08-04 141026/week @ 2020-08-11 161154/week @ 2020-08-18 160967/week @ 2020-08-25 153165/week @ 2020-09-01 169155/week @ 2020-09-08 172276/week @ 2020-09-15 178567/week @ 2020-09-22 200136/week @ 2020-09-29 212020/week @ 2020-10-06 197556/week @ 2020-10-13

674,445 downloads per month
Used in 7,072 crates (12 directly)

Zlib OR Apache-2.0 OR MIT

310KB
12K SLoC

License:Zlib Minimum Rust Version crates.io docs.rs

Unsafe-Zero-Percent

tinyvec

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

Dependencies