Skip to main content

Module seqstring

Module seqstring 

Source
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:

  1. Thread-local arena (fast, bulk-freed on strand exit)
  2. 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 over arena_bytes for callers that already have a Rust &str in hand.
global_bytes
Create globally-allocated bytes (persists across arena resets).
global_string
Create globally-allocated string from a UTF-8 String. Convenience wrapper over global_bytes for callers that already have a Rust String in hand.