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

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

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)

Bag of lengths for date and time.

Components(Bag)

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

Trait Implementations

impl Debug for DateTimeFormatOptions[src]

impl Default for DateTimeFormatOptions[src]

impl From<Bag> for DateTimeFormatOptions[src]

impl From<Bag> for DateTimeFormatOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.