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§
- Send
RefFoldable - 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).