[][src]Type Definition swim_mem::lease::SoftString

type SoftString<'a, M = ()> = Soft<'a, String<M>>;

Undereferenceable weak owner of a resizeable Unicode string stored in a Hold-allocated, atomically reference counted memory block.

Examples

Create a strongly referenced string, then obtain a weak reference to it:

let hard = HardString::from_copy("Hello");
let soft = hard.to_soft();

Recover a strong mutable reference from a soft reference, and concatenate it with another str using the + operator:

let hard = HardString::from_copy("Hello");
let soft = hard.to_soft();
let recover = unsafe { soft.try_to_mut() }.unwrap();
let message = recover + " world";