pub struct LazyPolicy;Expand description
A policy that wraps every argument in a re-forcing lazy thunk.
Each argument becomes a LazyThunkObject that re-evaluates whenever it
is forced; results are not cached between forces.
Trait Implementations§
Source§impl EvalPolicy for LazyPolicy
impl EvalPolicy for LazyPolicy
Source§fn allow_macro_expansion(&self, phase: Phase) -> bool
fn allow_macro_expansion(&self, phase: Phase) -> bool
Source§fn prepare_call_args(
&self,
cx: &mut Cx,
raw: RawArgs,
_demands: &[Demand],
) -> Result<PreparedArgs>
fn prepare_call_args( &self, cx: &mut Cx, raw: RawArgs, _demands: &[Demand], ) -> Result<PreparedArgs>
Prepares raw call arguments into
PreparedArgs per the demands. Read moreSource§fn force(&self, cx: &mut Cx, value: Value, demand: Demand) -> Result<Value>
fn force(&self, cx: &mut Cx, value: Value, demand: Demand) -> Result<Value>
Forces
value far enough to satisfy demand.Source§fn eval_expr(&self, cx: &mut Cx, expr: Expr) -> Result<Value>
fn eval_expr(&self, cx: &mut Cx, expr: Expr) -> Result<Value>
Evaluates a bare expression to a value under this policy.
Auto Trait Implementations§
impl Freeze for LazyPolicy
impl RefUnwindSafe for LazyPolicy
impl Send for LazyPolicy
impl Sync for LazyPolicy
impl Unpin for LazyPolicy
impl UnsafeUnpin for LazyPolicy
impl UnwindSafe for LazyPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more