[−][src]Type Definition swim_mem::lease::RawBox
type RawBox<'a, T, M = ()> = Raw<'a, Box<T, M>>;
Exclusive reference to a value stored in a Hold
-allocated memory block,
with optional metadata stored alongside the pointer.
Storing metadata in the pointer structure keeps the allocated memory block exactly the size of the value.
Examples
Move a value from the stack to the global hold by creating a RawBox
:
let value = 5; let boxed = RawBox::new(value);
Move a value from a RawBox
back to the stack by dereferencing:
let boxed = RawBox::new(5); let value = *boxed;