Expand description
A hierarchy of traits for abstracting over different types of pointers, specifically focusing on reference-counted pointers (Rc, Arc) and their capabilities.
The hierarchy is as follows:
Pointer: Base trait for any heap-allocated pointer.RefCountedPointer: Extension for pointers that allow shared ownership (cloning).SendRefCountedPointer: Extension for thread-safe reference-counted pointers.
Additionally, UnsizedCoercible and SendUnsizedCoercible are provided to support
coercing sized closures into trait objects (dyn Fn).
§Examples
use fp_library::{brands::*, functions::*};
let ptr = pointer_new::<RcBrand, _>(42);
assert_eq!(*ptr, 42);Traits§
- Pointer
- Base type class for heap-allocated pointers.
Functions§
- new
- Wraps a sized value in the pointer.