pub enum PreEvalOutcome {
Pass,
Rescope(Arc<Scope>),
Override(Box<Value>),
}Expand description
The outcome of a decorator’s pre-evaluation hook.
A decorator runs before the node it annotates is evaluated. It can either step aside, swap the active scope, or take over the value entirely.
Override boxes its Value to keep the enum small — Value is by far
the largest variant payload and most decorators choose Pass.
Variants§
Pass
Run the default evaluation path with the existing scope.
Rescope(Arc<Scope>)
Run the default evaluation path, but swap in this scope first.
Used by #import to inject the imported module’s bindings.
Override(Box<Value>)
Skip the default evaluation path; use this value as the result.
Used by #schema to interpret the body as a schema definition
rather than as data.
Auto Trait Implementations§
impl Freeze for PreEvalOutcome
impl RefUnwindSafe for PreEvalOutcome
impl Send for PreEvalOutcome
impl Sync for PreEvalOutcome
impl Unpin for PreEvalOutcome
impl UnsafeUnpin for PreEvalOutcome
impl UnwindSafe for PreEvalOutcome
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more