#[non_exhaustive]
pub enum DateTimeFormatterOptions {
    Length(Bag),
    Components(Bag),
}
Expand description

A bag of options which, together with Locale, defines how dates will be formatted with a TypedDateTimeFormatter instance.

Each variant of the bag is a combination of settings defining how to format the date, with an optional Preferences which represent user preferences and may alter how the selected pattern is formatted.

Examples

use icu::datetime::{options::length, DateTimeFormatterOptions};

let bag = length::Bag::from_date_time_style(
    length::Date::Medium,
    length::Time::Short,
);

At the moment only the length::Bag works, and we plan to extend that to support ECMA402 like components bag later.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Length(Bag)

Bag of lengths for date and time.

Components(Bag)

Bag of components describing which fields and how should be displayed.

🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, including in SemVer minor releases. It can be enabled with the "experimental" feature of the icu meta-crate. Use with caution. #1317

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
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.

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.