Skip to main content

Module send_ref_functor

Module send_ref_functor 

Source
Expand description

Types that can be mapped over by receiving references to their contents, with thread-safe mapping functions.

§Examples

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

let memo = ArcLazy::new(|| 10);
let mapped = send_ref_map::<LazyBrand<ArcLazyConfig>, _, _>(|x: &i32| *x * 2, &memo);
assert_eq!(*mapped.evaluate(), 20);

Traits§

SendRefFunctor
A type class for types that can be mapped over, receiving references, with thread-safe functions.

Functions§

send_ref_map
Maps a thread-safe function over the values in the functor context, where the function takes a reference.