#vec #no-std #no-std

no-std tinyvec

tinyvec provides 100% safe vec-like data structures

26 releases (7 stable)

new 1.3.1 Jul 22, 2021
1.2.0 Apr 4, 2021
1.1.1 Jan 26, 2021
1.1.0 Nov 19, 2020
0.3.3 Mar 26, 2020

#40 in Data structures

Download history 369519/week @ 2021-04-07 357074/week @ 2021-04-14 350021/week @ 2021-04-21 349317/week @ 2021-04-28 349483/week @ 2021-05-05 340884/week @ 2021-05-12 326985/week @ 2021-05-19 326104/week @ 2021-05-26 317127/week @ 2021-06-02 339205/week @ 2021-06-09 346041/week @ 2021-06-16 332828/week @ 2021-06-23 326819/week @ 2021-06-30 340672/week @ 2021-07-07 345075/week @ 2021-07-14 373892/week @ 2021-07-21

1,438,008 downloads per month
Used in 9,885 crates (30 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