Skip to main content

StrictNames

Struct StrictNames 

Source
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: P

Policy that supplies all behavior except unbound-name resolution.

Trait Implementations§

Source§

impl<P: EvalPolicy> EvalPolicy for StrictNames<P>

Source§

fn name(&self) -> &'static str

A stable, human-readable name for this policy.
Source§

fn allow_macro_expansion(&self, phase: Phase) -> bool

Whether macro expansion is permitted in the given Phase. Read more
Source§

fn prepare_call_args( &self, cx: &mut Cx, raw: RawArgs, demands: &[Demand], ) -> Result<PreparedArgs>

Prepares raw call arguments into PreparedArgs per the demands. Read more
Source§

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>

Evaluates a bare expression to a value under this policy.
Source§

fn resolve_unbound_symbol(&self, _cx: &mut Cx, symbol: Symbol) -> Result<Value>

Resolve a symbol that bound to nothing in value position. Read more
Source§

fn resolve_unbound_call( &self, _cx: &mut Cx, operator: Symbol, _args: Vec<Expr>, ) -> Result<Value>

Resolve a call whose operator bound to nothing. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.