Skip to main content

Module send_ref_apply_first

Module send_ref_apply_first 

Source
Expand description

Thread-safe combining of two by-ref contexts, keeping the first value, with send_ref_apply_first.

This is the thread-safe counterpart of RefApplyFirst.

§Examples

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

let x = ArcLazy::new(|| 3);
let y = ArcLazy::new(|| 4);
let result = send_ref_apply_first::<LazyBrand<ArcLazyConfig>, _, _>(&x, &y);
assert_eq!(*result.evaluate(), 3);

Traits§

SendRefApplyFirst
A type class for combining two thread-safe by-ref contexts, keeping the first value.

Functions§

send_ref_apply_first
Combines two thread-safe contexts, keeping the value from the first.