pub enum WhenExpr {
Literal(Value),
Ident {
ns: Namespace,
name: String,
},
Call {
ns: Namespace,
method: String,
args: Vec<WhenExpr>,
},
Not(Box<WhenExpr>),
And(Box<WhenExpr>, Box<WhenExpr>),
Or(Box<WhenExpr>, Box<WhenExpr>),
Cmp {
left: Box<WhenExpr>,
op: CmpOp,
right: Box<WhenExpr>,
},
Matches {
left: Box<WhenExpr>,
pattern: Regex,
},
List(Vec<WhenExpr>),
}Variants§
Literal(Value)
Ident
Call
<ns>.<method>(args...). Currently only the iter
namespace exposes callable methods; an unknown
(namespace, method) pair is rejected at parse time so
typos don’t silently coerce to null like value-style
idents do.
Not(Box<WhenExpr>)
And(Box<WhenExpr>, Box<WhenExpr>)
Or(Box<WhenExpr>, Box<WhenExpr>)
Cmp
Matches
left matches <compiled regex> — RHS is compiled at parse time.
List(Vec<WhenExpr>)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WhenExpr
impl RefUnwindSafe for WhenExpr
impl Send for WhenExpr
impl Sync for WhenExpr
impl Unpin for WhenExpr
impl UnsafeUnpin for WhenExpr
impl UnwindSafe for WhenExpr
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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