1 unstable release
Uses new Rust 2024
new 0.1.0 | Mar 16, 2025 |
---|
#573 in Procedural macros
Used in maxlen
6KB
105 lines
maxlen
Length-bounded wrappers over standard types.
This crate provides several types that enforce length limits at the type level:
BSlice<T, MAX>
is a[T]
but guaranteed to not have more thanMAX
elements.BVec<T, MAX>
is aVec<T>
but guaranteed to not have more thanMAX
elements.BStr<MAX, E>
is astr
but guarantees that the text will not be longer thanMAX
bytes in the specified encoding (not necessarily UTF-8).BString<MAX, E>
is aString
but guarantees that the text will not be longer thanMAX
bytes in the specified encoding (not necessarily UTF-8).
Dependencies
~225–660KB
~15K SLoC