| Crates.io | maxlen |
| lib.rs | maxlen |
| version | 0.2.0 |
| created_at | 2025-03-16 19:38:25.364924+00 |
| updated_at | 2025-03-27 19:08:28.417805+00 |
| description | Length-bounded string and slice/vector |
| homepage | |
| repository | https://github.com/PonasKovas/maxlen |
| max_upload_size | |
| id | 1594705 |
| size | 94,758 |
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 than MAX elements.BVec<T, MAX> is a Vec<T> but guaranteed to not have more than MAX elements.BStr<MAX, E> is a str but guarantees that the text will not be longer than MAX bytes in the specified encoding (not necessarily UTF-8).BString<MAX, E> is a String but guarantees that the text will not be longer than MAX bytes in the specified encoding (not necessarily UTF-8).