bounded-vec
BoundedVec<T, L, U>
- Non-empty rust std::vec::Vec
wrapper with type guarantees on lower(L
) and upper(U
) bounds for items quantity. Inspired by vec1.
This crate is #![no_std]
compatible with alloc
.
Example
use BoundedVec;
let data: = .into;
assert_eq!;
assert_eq!;
// creates a new BoundedVec by mapping each element
let data = data.mapped;
assert_eq!;
Crate features
- optional(non-default) serde feature that adds serialization to
BoundedVec
. - optional(non-default)
schema
feature that adds JSON schema support via schemars (requiresserde
). - optional(non-default)
arbitrary
feature that addsproptest::Arbitrary
implementation toBoundedVec
.
Changelog
See CHANGELOG.md.
Contributing
See Contributing guide.