Enum icu_datetime::options::DateTimeFormatOptions[][src]

pub enum DateTimeFormatOptions {
    Length(Bag),
    Components(Bag),
}
Expand description

A bag of options which, together with Locale, defines how dates will be formatted with a DateTimeFormat 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::{DateTimeFormatOptions, options::length};

let options = DateTimeFormatOptions::Length(
    length::Bag {
         date: Some(length::Date::Medium),
         time: Some(length::Time::Short),
        ..Default::default()
    }
);

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

Variants

Length

Bag of lengths for date and time.

Tuple Fields of Length

0: Bag
Components

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

Tuple Fields of Components

0: Bag

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

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

Clone this trait object reference, returning a boxed trait object.

Return this boxed trait object as Box<dyn Any>. Read more

Return this trait object reference as &dyn Any. Read more

Performs the conversion.

Performs the conversion.

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.