Cargo Features

TinyVec has no features set by default.

[dependencies]
tinyvec = { version = "1.6.0", features = ["alloc", "std", "grab_spare_slice", "rustc_1_40", "rustc_1_55", "rustc_1_57", "nightly_slice_partition_dedup", "experimental_write_impl", "real_blackbox", "serde", "arbitrary"] }
alloc std? = tinyvec_macros

Provide things that utilize the alloc crate, namely TinyVec.

std = alloc

Provide things that require Rust's std module

grab_spare_slice

(not part of Vec!) Extra methods to let you grab the slice of memory after the "active" portion of an ArrayVec or SliceVec.

rustc_1_40 rustc_1_55?

features that require rustc 1.40
use Vec::append if possible in TinyVec::append - 1.37
DoubleEndedIterator::nth_back - 1.40

rustc_1_55 rustc_1_57? = rustc_1_40

features that require rustc 1.55
use const generics to implement Array for all array lengths

rustc_1_57 = rustc_1_55

features that require rustc 1.57
add try_reserve functions to types that heap allocate.

nightly_slice_partition_dedup

allow use of nightly feature slice_partition_dedup, will become useless once that is stabilized: https://github.com/rust-lang/rust/issues/54279

experimental_write_impl

EXPERIMENTAL: Not part of SemVer. It adds core::fmt::Write to ArrayVec and SliceVec. It works on Stable Rust, but Vec normally supports the std::io::Write trait instead of core::fmt::Write, so we're keeping it as an experimental impl only for now.

real_blackbox dev

Some benchmarks are optimized away with the stable black_box function which is based on read_volatile. This feature requires inline assembly and thus a nightly compiler, but is only used in benchmarks.

Enables real_blackbox of criterion ^0.3.0

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

tinyvec_macros alloc?
serde implicit feature

Enables serde

Provides Serialize and Deserialize implementations

arbitrary implicit feature

Enables arbitrary

Provides derived Arbitrary implementations