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)
schemafeature that adds JSON schema support via schemars (requiresserde). - optional(non-default)
arbitraryfeature that addsproptest::Arbitraryimplementation toBoundedVec.
Changelog
See CHANGELOG.md.
Contributing
See Contributing guide.