pub struct StrictNames<P>(pub P);Expand description
Wraps any EvalPolicy so unbound names fail with precise errors.
The wrapped policy still controls argument strategy, forcing, macro
expansion, and expression evaluation. StrictNames changes only unbound
symbol and unbound call resolution.
Tuple Fields§
§0: PPolicy that supplies all behavior except unbound-name resolution.
Trait Implementations§
Source§impl<P: EvalPolicy> EvalPolicy for StrictNames<P>
impl<P: EvalPolicy> EvalPolicy for StrictNames<P>
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<P> Freeze for StrictNames<P>where
P: Freeze,
impl<P> RefUnwindSafe for StrictNames<P>where
P: RefUnwindSafe,
impl<P> Send for StrictNames<P>where
P: Send,
impl<P> Sync for StrictNames<P>where
P: Sync,
impl<P> Unpin for StrictNames<P>where
P: Unpin,
impl<P> UnsafeUnpin for StrictNames<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for StrictNames<P>where
P: UnwindSafe,
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