Struct icu_plurals::rules::ast::Condition [−][src]
pub struct Condition(pub Box<[AndCondition]>);
Expand description
A complete AST representation of a plural rule’s condition. Comprises a vector of AndConditions
.
Examples
use icu::plurals::rules::ast::*; use icu::plurals::rules::parse_condition; let condition = Condition(Box::new([ AndCondition(Box::new([Relation { expression: Expression { operand: Operand::I, modulus: None, }, operator: Operator::Eq, range_list: RangeList(Box::new([RangeListItem::Value(Value(5))])), }])), AndCondition(Box::new([Relation { expression: Expression { operand: Operand::V, modulus: None, }, operator: Operator::Eq, range_list: RangeList(Box::new([RangeListItem::Value(Value(2))])), }])), ])); assert_eq!( condition, parse_condition(b"i = 5 or v = 2") .expect("Parsing failed") )
Tuple Fields
0: Box<[AndCondition]>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Condition
impl UnwindSafe for Condition
Blanket Implementations
Mutably borrows from an owned value. Read more
Clone this trait object reference, returning a boxed trait object.