Expand description
SeqString - Arena or Globally Allocated Byte String
Strings in Seq are sequences of arbitrary bytes — there is no
UTF-8 invariant on this type. Byte-clean operations (concat,
length-in-bytes, channel send, network I/O, file I/O of binary
content, crypto inputs) work on any input. Text-level operations
(codepoint length, case folding, regex Unicode classes, JSON
escaping) call SeqString::as_str which validates UTF-8 at the
boundary and returns Option<&str>; on invalid bytes those ops
fail loudly with the standard (value Bool) failure tuple.
The two allocation sources stay:
- Thread-local arena (fast, bulk-freed on strand exit)
- Global allocator (persists across arena resets, used for cross-strand transfer)
See docs/design/STRING_BYTE_CLEANLINESS.md for the full design.
Structs§
- SeqString
- Byte string that tracks its allocation source.
Functions§
- arena_
bytes - Create arena-allocated bytes (fast path for temporaries).
- arena_
string - Create arena-allocated string from a UTF-8
&str. Convenience wrapper overarena_bytesfor callers that already have a Rust&strin hand. - global_
bytes - Create globally-allocated bytes (persists across arena resets).
- global_
string - Create globally-allocated string from a UTF-8
String. Convenience wrapper overglobal_bytesfor callers that already have a RustStringin hand.