pub struct Rule {
    pub condition: Condition,
    pub samples: Option<Samples>,
}Expand description
A complete AST representation of a plural rule.
Comprises a vector of AndConditions and optionally a set of Samples.
๐ง 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
use icu::plurals::provider::rules::reference::ast::*;
use icu::plurals::provider::rules::reference::{parse, parse_condition};
let condition =
    parse_condition(b"i = 5 or v = 2").expect("Parsing failed.");
let samples = Samples {
    integer: Some(SampleList {
        sample_ranges: vec![SampleRange {
            lower_val: DecimalValue("2".to_string()),
            upper_val: None,
        }],
        ellipsis: true,
    }),
    decimal: Some(SampleList {
        sample_ranges: vec![SampleRange {
            lower_val: DecimalValue("2.5".to_string()),
            upper_val: None,
        }],
        ellipsis: false,
    }),
};
let rule = Rule {
    condition,
    samples: Some(samples),
};
assert_eq!(
    rule,
    parse("i = 5 or v = 2 @integer 2, โฆ @decimal 2.5".as_bytes())
        .expect("Parsing failed")
)Fieldsยง
ยงcondition: ConditionThe set of conditions that each must be satisfied for the entire Rule to be satisfied
samples: Option<Samples>The set of sample numerical values matching each plural category that has a rule, or None if not present.
Trait Implementationsยง
impl StructuralPartialEq for Rule
Auto Trait Implementationsยง
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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