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

type RefBuf<'a, T, M = ()> = Ref<'a, Buf<T, M>>;

Immutably dereferenceable strong owner of a resizeable array of values stored in a Hold-allocated, atomically reference counted memory block.

Examples

Create an empty RefBuf that will allocate space in the global hold:

let buf = RefBuf::<u8>::empty();

Clone a slice into a newly allocated RefBuf:

let buf = RefBuf::<u8>::from_clone(&[2, 3]);

Access elements by index:

let buf = RefBuf::<u8>::from_clone(&[1, 2, 3]);
let three = buf[2];