pub struct AndCondition(pub Vec<Relation>);
Expand description
An incomplete AST representation of a plural rule. Comprises a vector of Relations
.
🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. In particular, the `DataProvider` implementations are only
guaranteed to match with this version's `*_unstable` providers. Use with caution.
§Examples
All AST nodes can be built explicitly, as seen in the example. However, due to its complexity, it is preferred to build the
AST using the parse()
function.
"i = 3 and v = 0"
Can be represented by the AST:
use icu::plurals::provider::rules::reference::ast::*;
AndCondition(vec![
Relation {
expression: Expression {
operand: Operand::I,
modulus: None,
},
operator: Operator::Eq,
range_list: RangeList(vec![RangeListItem::Value(Value(5))]),
},
Relation {
expression: Expression {
operand: Operand::V,
modulus: None,
},
operator: Operator::NotEq,
range_list: RangeList(vec![RangeListItem::Value(Value(2))]),
},
]);
Tuple Fields§
§0: Vec<Relation>
Trait Implementations§
Source§impl Clone for AndCondition
impl Clone for AndCondition
Source§fn clone(&self) -> AndCondition
fn clone(&self) -> AndCondition
Returns a copy 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 Debug for AndCondition
impl Debug for AndCondition
Source§impl PartialEq for AndCondition
impl PartialEq for AndCondition
impl StructuralPartialEq for AndCondition
Auto Trait Implementations§
impl Freeze for AndCondition
impl RefUnwindSafe for AndCondition
impl Send for AndCondition
impl Sync for AndCondition
impl Unpin for AndCondition
impl UnwindSafe for AndCondition
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> 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