pub enum Expression<'a> {
String(Cow<'a, str>),
Number(u32),
Boolean(bool),
List(Vec<Expression<'a>>),
BinaryOperation(Box<BinaryOperation<'a>>),
Range(Box<Range<'a>>),
Named(NamedExpression<'a>),
Verdict(Verdict<'a>),
}
Expand description
Expressions are the building blocks of (most) statements. In their most basic form, they are just immediate values represented as a JSON string, integer or boolean type.
Variants§
String(Cow<'a, str>)
A string expression (immediate expression). For string expressions there are two special cases:
@STRING
: The remaining part is taken as set name to create a set reference.\*
: Construct a wildcard expression.
Number(u32)
An integer expression (immediate expression).
Boolean(bool)
A boolean expression (immediate expression).
List(Vec<Expression<'a>>)
List expressions are constructed by plain arrays containing of an arbitrary number of expressions.
BinaryOperation(Box<BinaryOperation<'a>>)
A binary operation expression.
Range(Box<Range<'a>>)
Construct a range of values.
The first array item denotes the lower boundary, the second one the upper boundary.
Named(NamedExpression<'a>)
Wrapper for non-immediate expressions.
Verdict(Verdict<'a>)
A verdict expression (used in verdict maps).
Trait Implementations§
Source§impl<'a> Clone for Expression<'a>
impl<'a> Clone for Expression<'a>
Source§fn clone(&self) -> Expression<'a>
fn clone(&self) -> Expression<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for Expression<'a>
impl<'a> Debug for Expression<'a>
Source§impl<'de, 'a> Deserialize<'de> for Expression<'a>
impl<'de, 'a> Deserialize<'de> for Expression<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> JsonSchema for Expression<'a>
impl<'a> JsonSchema for Expression<'a>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl<'a> PartialEq for Expression<'a>
impl<'a> PartialEq for Expression<'a>
Source§impl<'a> Serialize for Expression<'a>
impl<'a> Serialize for Expression<'a>
impl<'a> Eq for Expression<'a>
impl<'a> StructuralPartialEq for Expression<'a>
Auto Trait Implementations§
impl<'a> Freeze for Expression<'a>
impl<'a> RefUnwindSafe for Expression<'a>
impl<'a> Send for Expression<'a>
impl<'a> Sync for Expression<'a>
impl<'a> Unpin for Expression<'a>
impl<'a> UnwindSafe for Expression<'a>
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