Module thunk_wrapper

Module thunk_wrapper 

Source
Expand description

A trait for pointers that can wrap a thunk with interior mutability.

§Examples

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

let cell = thunk_wrapper_new::<RcBrand, _>(Some(42));
assert_eq!(thunk_wrapper_take::<RcBrand, _>(&cell), Some(42));

Traits§

ThunkWrapper
Trait for pointers that can wrap a thunk with interior mutability.

Functions§

new
Creates a new cell containing the value.
take
Takes the value out of the cell.