Module ref_counted_pointer

Module ref_counted_pointer 

Source
Expand description

A trait for reference-counted pointers with shared ownership.

§Examples

use fp_library::{brands::*, functions::*};

let ptr = ref_counted_pointer_new::<RcBrand, _>(42);
let clone = ptr.clone();
assert_eq!(*clone, 42);

Traits§

RefCountedPointer
Extension trait for reference-counted pointers with shared ownership.

Functions§

cloneable_new
Wraps a sized value in a cloneable pointer.
try_unwrap
Attempts to unwrap the inner value if this is the sole reference.