Skip to main content

Module send_ref_pointed

Module send_ref_pointed 

Source
Expand description

Thread-safe by-ref value injection with send_ref_pure.

Like RefPointed::ref_pure, but requires A: Send + Sync + Clone so the result can cross thread boundaries.

§Examples

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

let value = 42;
let lazy = send_ref_pure::<LazyBrand<ArcLazyConfig>, _>(&value);
assert_eq!(*lazy.evaluate(), 42);

Traits§

SendRefPointed
A type class for injecting a value into a context from a reference, with Send + Sync bounds.

Functions§

send_ref_pure
Wraps a cloned value in a new thread-safe memoized context.