pub trait Thunk: Send + Sync {
// Required method
fn force(&self, cx: &mut Cx, demand: Demand) -> Result<Value>;
}Expand description
A delayed computation that produces a value when forced.
Thunks are how lazy and call-by-need eval policies defer argument
evaluation: the value is computed only when force is
called to satisfy a Demand. The kernel defines the contract and two
reference objects (LazyThunkObject and ThunkObject); libraries may
supply their own.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".