#vec #no-std #no-std

no-std tinyvec

tinyvec provides 100% safe vec-like data structures

29 releases (10 stable)

1.5.1 Nov 9, 2021
1.3.1 Jul 22, 2021
1.1.1 Jan 26, 2021
1.1.0 Nov 19, 2020
0.3.3 Mar 26, 2020

#14 in Data structures

Download history 424427/week @ 2021-08-15 421929/week @ 2021-08-22 426746/week @ 2021-08-29 405198/week @ 2021-09-05 507903/week @ 2021-09-12 491845/week @ 2021-09-19 502240/week @ 2021-09-26 513985/week @ 2021-10-03 523642/week @ 2021-10-10 530130/week @ 2021-10-17 499882/week @ 2021-10-24 513349/week @ 2021-10-31 535738/week @ 2021-11-07 548019/week @ 2021-11-14 466304/week @ 2021-11-21 534855/week @ 2021-11-28

2,133,094 downloads per month
Used in 10,982 crates (39 directly)

Zlib OR Apache-2.0 OR MIT

340KB
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

ˊa