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

type SoftBox<'a, T, M = ()> = Soft<'a, Box<T, M>>;

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

Examples

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

let hard = HardBox::new(5);
let soft = hard.to_soft();

Recover a strong reference from a soft reference:

let hard = HardBox::new(5);
let soft = hard.to_soft();
let recover = soft.try_to_ref().unwrap();