pub struct Expr<T: FromValue = OwnedDataValue> { /* private fields */ }Expand description
Compiled JSONLogic resolving to a T, made by
ExprEngine::compile.
An expression that reads nothing folds at compile into a constant, and every evaluation lends that constant from the expression, never cloning it.
Implementations§
Trait Implementations§
Source§impl<T: FromValue> ConfigField for Expr<T>
impl<T: FromValue> ConfigField for Expr<T>
Source§const NULL_IS_VALUE: bool = true
const NULL_IS_VALUE: bool = true
null is a constant expression.
Source§fn compile(raw: &Value, cx: &mut CompileCx<'_>) -> Option<Self>
fn compile(raw: &Value, cx: &mut CompileCx<'_>) -> Option<Self>
Compiles
raw; None after recording at least one issue.Source§fn resolve(&self, r: &mut dyn Resolver) -> Result<Option<OwnedDataValue>>
fn resolve(&self, r: &mut dyn Resolver) -> Result<Option<OwnedDataValue>>
The field’s value for this call, resolved through
r, or None when
it has none (an Option the input left unset, with no default). The
value sits where Self::visit reports the field’s expressions: a
list’s elements at their indices, a map’s values at their keys, and
an element left unset is null, keeping its place. Read moreSource§const IS_OUTPUT: bool = false
const IS_OUTPUT: bool = false
Whether the field is an output: a destination its call writes to.
false unless the type is Output or an
Option of one. The derive reads a field typed Output or marked
#[output] as an output and asserts that this is true, so a type
that merely shares the name is refused at compile time.Auto Trait Implementations§
impl<T = OwnedDataValue> !Freeze for Expr<T>
impl<T> RefUnwindSafe for Expr<T>where
Option<T>: RefUnwindSafe,
impl<T> Send for Expr<T>
impl<T> Sync for Expr<T>
impl<T> Unpin for Expr<T>
impl<T> UnsafeUnpin for Expr<T>where
Option<T>: UnsafeUnpin,
impl<T> UnwindSafe for Expr<T>where
Option<T>: 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