pub enum AstElement<'s> {
Literal {
value: String,
span: Option<Span>,
},
Argument {
value: String,
span: Option<Span>,
},
Number {
value: String,
span: Option<Span>,
style: Option<NumberArgStyle<'s>>,
},
Date {
value: String,
span: Option<Span>,
style: Option<DateTimeArgStyle<'s>>,
},
Time {
value: String,
span: Option<Span>,
style: Option<DateTimeArgStyle<'s>>,
},
Select {
value: String,
span: Option<Span>,
options: PluralOrSelectOptions<'s>,
},
Plural {
value: String,
plural_type: PluralType,
span: Option<Span>,
offset: i64,
options: PluralOrSelectOptions<'s>,
},
Pound(Span),
Tag {
value: &'s str,
span: Option<Span>,
children: Box<Ast<'s>>,
},
}
Variants§
Literal
Raw text
Argument
Variable w/o any format, e.g var
in this is a {var}
Number
Variable w/ number format
Date
Variable w/ date format
Time
Variable w/ time format
Select
Variable w/ select format
Plural
Variable w/ plural format
Pound(Span)
Only possible within plural argument.
This is the #
symbol that will be substituted with the count.
Tag
XML-like tag
Trait Implementations§
Source§impl<'s> Clone for AstElement<'s>
impl<'s> Clone for AstElement<'s>
Source§fn clone(&self) -> AstElement<'s>
fn clone(&self) -> AstElement<'s>
Returns a duplicate 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<'s> Debug for AstElement<'s>
impl<'s> Debug for AstElement<'s>
Source§impl<'s> PartialEq for AstElement<'s>
impl<'s> PartialEq for AstElement<'s>
Source§impl<'s> Serialize for AstElement<'s>
impl<'s> Serialize for AstElement<'s>
impl<'s> StructuralPartialEq for AstElement<'s>
Auto Trait Implementations§
impl<'s> Freeze for AstElement<'s>
impl<'s> RefUnwindSafe for AstElement<'s>
impl<'s> Send for AstElement<'s>
impl<'s> Sync for AstElement<'s>
impl<'s> Unpin for AstElement<'s>
impl<'s> UnwindSafe for AstElement<'s>
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