Skip to main content

Module send_ref_foldable

Module send_ref_foldable 

Source
Expand description

Thread-safe by-reference variant of Foldable.

User story: “I want to fold over a thread-safe memoized value by reference.”

§Examples

use fp_library::{
	brands::*,
	classes::send_ref_foldable::*,
	types::*,
};

let lazy = ArcLazy::new(|| 10);
let result = send_ref_fold_map::<ArcFnBrand, LazyBrand<ArcLazyConfig>, _, _>(
	|a: &i32| a.to_string(),
	&lazy,
);
assert_eq!(result, "10");

Traits§

SendRefFoldable
Thread-safe by-reference folding over a structure.

Functions§

send_ref_fold_map
Maps values to a monoid by reference and combines them (thread-safe).