[−][src]Type Definition swim_mem::lease::RawString
type RawString<'a, M = ()> = Raw<'a, String<M>>;
Exclusive reference to a resizeable Unicode string stored in a
Hold
-allocated memory block, with string length and capacity metadata
stored alongside the pointer.
Storing string metadata in the pointer structure keeps the allocated memory block exactly the size of the string capacity.
Examples
Copy a string literal into a RawString
allocated in the global hold:
let s = RawString::from_copy("Hello");
Concatenate a RawString
with another str
using the +
operator:
let s = RawString::from_copy("Hello"); let message = s + " world";