pub enum Expr {
Ref(String),
Lit(Literal),
Add {
left: Box<Expr>,
right: Box<Expr>,
},
Sub {
left: Box<Expr>,
right: Box<Expr>,
},
Mul {
left: Box<Expr>,
right: Box<Expr>,
},
Div {
left: Box<Expr>,
right: Box<Expr>,
},
Round {
value: Box<Expr>,
scale: u32,
},
Fx {
amount: Box<Expr>,
from: Box<Expr>,
to: Box<Expr>,
rates: String,
scale: u32,
},
Len(Box<Expr>),
ToDecimal(Box<Expr>),
Graded {
reference: String,
require: GradeRequirement,
},
}Expand description
Expressions inside exact-operator arguments and policy predicates
(registry rustev.exact/1). References are input:<name>,
step:<id>, item:<field>[.<field>...] (inside a per-item operator) and
now.
Variants§
Ref(String)
Lit(Literal)
Add
Sub
Mul
Decimal product rounded half-even to 10^-9; integers are exact.
Div
Decimal quotient rounded half-even to 10^-9.
Round
Rescale a decimal half-even to scale digits.
Fx
Currency conversion through a rate table (fx_convert@1 semantics).
Len(Box<Expr>)
Length of a list.
ToDecimal(Box<Expr>)
Integer to decimal, the only numeric conversion.
Graded
Registry rustev.exact/2: a reference with a grade requirement
(spec 032, 3.9.1).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
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
impl Eq for Expr
Source§impl JsonSchema for Expr
impl JsonSchema for Expr
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 inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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