#vec #no-std #no-std

no-std tinyvec

tinyvec provides 100% safe vec-like data structures

24 releases (5 stable)

1.2.0 Apr 4, 2021
1.1.1 Jan 26, 2021
1.1.0 Nov 19, 2020
0.4.1 Jul 24, 2020
0.3.3 Mar 26, 2020

#14 in Data structures

Download history 160699/week @ 2020-12-25 225777/week @ 2021-01-01 270066/week @ 2021-01-08 252269/week @ 2021-01-15 291708/week @ 2021-01-22 299227/week @ 2021-01-29 293134/week @ 2021-02-05 297970/week @ 2021-02-12 323780/week @ 2021-02-19 325018/week @ 2021-02-26 305467/week @ 2021-03-05 314229/week @ 2021-03-12 313647/week @ 2021-03-19 331713/week @ 2021-03-26 335125/week @ 2021-04-02 305631/week @ 2021-04-09

1,274,713 downloads per month
Used in 9,007 crates (24 directly)

Zlib OR Apache-2.0 OR MIT

335KB
13K 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