pub enum IcuNode {
Show 13 variants
Literal(String),
Argument {
name: String,
},
Number {
name: String,
style: Option<String>,
},
Date {
name: String,
style: Option<String>,
},
Time {
name: String,
style: Option<String>,
},
List {
name: String,
style: Option<String>,
},
Duration {
name: String,
style: Option<String>,
},
Ago {
name: String,
style: Option<String>,
},
Name {
name: String,
style: Option<String>,
},
Select {
name: String,
options: Vec<IcuOption>,
},
Plural {
name: String,
kind: IcuPluralKind,
offset: u32,
options: Vec<IcuOption>,
},
Pound,
Tag {
name: String,
children: Vec<IcuNode>,
},
}Expand description
AST node emitted by the ICU parser.
Variants§
Literal(String)
Literal text content.
Argument
Simple argument substitution such as {name}.
Number
Number formatter such as {count, number}.
Date
Date formatter such as {createdAt, date, short}.
Time
Time formatter such as {createdAt, time, short}.
List
List formatter such as {items, list}.
Duration
Duration formatter such as {elapsed, duration}.
Ago
Relative-time “ago” formatter.
Name
Name formatter.
Select
Select expression with labeled branches.
Plural
Cardinal or ordinal plural expression.
Fields
§
kind: IcuPluralKindWhether the plural expression is cardinal or ordinal.
Pound
# placeholder inside plural branches.
Tag
Rich-text style tag with nested children.
Trait Implementations§
impl Eq for IcuNode
impl StructuralPartialEq for IcuNode
Auto Trait Implementations§
impl Freeze for IcuNode
impl RefUnwindSafe for IcuNode
impl Send for IcuNode
impl Sync for IcuNode
impl Unpin for IcuNode
impl UnsafeUnpin for IcuNode
impl UnwindSafe for IcuNode
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