Expand description
Thread-safe cloneable wrappers over closures that carry Send + Sync bounds.
§Examples
use {
fp_library::{
brands::*,
functions::*,
},
std::thread,
};
let f = send_lift_fn_new::<ArcFnBrand, _, _>(|x: i32| x * 2);
// Can be sent to another thread
let handle = thread::spawn(move || {
assert_eq!(f(5), 10);
});
handle.join().unwrap();Traits§
- Send
Clone Fn - Abstraction for thread-safe cloneable wrappers over closures.
- Send
Lift Fn - A trait for constructing thread-safe cloneable function wrappers from closures.
- Send
RefLift Fn - A trait for constructing thread-safe Ref-mode cloneable function wrappers.