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

Fields

value: String
span: Option<Span>

Raw text

Argument

Fields

value: String
span: Option<Span>

Variable w/o any format, e.g var in this is a {var}

Number

Fields

value: String
span: Option<Span>
style: Option<NumberArgStyle<'s>>

Variable w/ number format

Date

Fields

value: String
span: Option<Span>
style: Option<DateTimeArgStyle<'s>>

Variable w/ date format

Time

Fields

value: String
span: Option<Span>
style: Option<DateTimeArgStyle<'s>>

Variable w/ time format

Select

Fields

value: String
span: Option<Span>
options: PluralOrSelectOptions<'s>

Variable w/ select format

Plural

Fields

value: String
plural_type: PluralType
span: Option<Span>
offset: i64
options: PluralOrSelectOptions<'s>

Variable w/ plural format

Pound(Span)

Only possible within plural argument. This is the # symbol that will be substituted with the count.

Tag

Fields

value: &'s str
span: Option<Span>
children: Box<Ast<'s>>

XML-like tag

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.