Skip to main content

HarnStr

Type Alias HarnStr 

Source
pub type HarnStr = ArcStr;
Expand description

Thin, reference-counted, immutable UTF-8 string used by every string-shaped VmValue variant (String, BuiltinRef, TaskHandle).

Unlike Arc<str> — whose fat pointer (data ptr + length) is 16 bytes and set the whole-enum size floor — arcstr::ArcStr is a single word: the length lives in the heap allocation alongside the refcount and bytes. That is what lets VmValue shrink to 16 bytes (paired with boxing the other oversized payloads). Cloning is a refcount bump, identical to Arc<str>; the unsafe pointer arithmetic is encapsulated and fuzzed inside the vetted arcstr crate, so the VM carries no hand-rolled unsafe for this.

Aliased Type§

pub struct HarnStr(/* private fields */);