pub fn take_cell_new<'a, P: RefCountedPointer, T: 'a>(
value: T,
) -> P::TakeCellOf<'a, T>Expand description
Creates a new take-cell containing the given value.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall P T. RefCountedPointer P => T -> P T
§Type Parameters
'a: The pointer brand.P: The lifetime of the value.T: The type of the value to store.
§Parameters
value: The value to store in the cell.
§Returns
A new take-cell containing the value.
§Examples
use fp_library::{
brands::*,
functions::*,
};
let cell = take_cell_new::<RcBrand, _>(42);
assert_eq!(take_cell_take::<RcBrand, _>(&cell), Some(42));