Expand description
A byte string backed by SmallVec.
SmallByteStr<N> stores up to N bytes inline on the stack. When the buffer grows
beyond N bytes, it spills to a heap-allocated buffer. Unlike SmallStr,
no UTF-8 validity is enforced.
§Examples
use planck_noalloc::smallbytestr::SmallByteStr;
let mut bs = SmallByteStr::<8>::new();
bs.push(0x48); // 'H'
bs.push(0x69); // 'i'
assert_eq!(bs.as_bytes(), b"Hi");
assert!(bs.is_inline());Structs§
- Small
Byte Str - A byte string that stores up to
Nbytes inline, spilling to the heap when exceeded.