Enum icu::datetime::options::DateTimeFormatterOptions
source · #[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 formatter 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;
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.
✨ Enabled with the experimental
Cargo feature.
🚧 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` Cargo feature
of the icu meta-crate. Use with caution.
#1317
Trait Implementations§
source§impl Clone for DateTimeFormatterOptions
impl Clone for DateTimeFormatterOptions
source§fn clone(&self) -> DateTimeFormatterOptions
fn clone(&self) -> DateTimeFormatterOptions
Returns a copy 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 Debug for DateTimeFormatterOptions
impl Debug for DateTimeFormatterOptions
source§impl Default for DateTimeFormatterOptions
impl Default for DateTimeFormatterOptions
source§fn default() -> DateTimeFormatterOptions
fn default() -> DateTimeFormatterOptions
Returns the “default value” for a type. Read more
source§impl From<Bag> for DateTimeFormatterOptions
impl From<Bag> for DateTimeFormatterOptions
source§fn from(input: Bag) -> DateTimeFormatterOptions
fn from(input: Bag) -> DateTimeFormatterOptions
Converts to this type from the input type.
source§impl From<Bag> for DateTimeFormatterOptions
impl From<Bag> for DateTimeFormatterOptions
source§fn from(input: Bag) -> DateTimeFormatterOptions
fn from(input: Bag) -> DateTimeFormatterOptions
Converts to this type from the input type.
source§impl Hash for DateTimeFormatterOptions
impl Hash for DateTimeFormatterOptions
source§impl PartialEq for DateTimeFormatterOptions
impl PartialEq for DateTimeFormatterOptions
impl Copy for DateTimeFormatterOptions
impl Eq for DateTimeFormatterOptions
impl StructuralPartialEq for DateTimeFormatterOptions
Auto Trait Implementations§
impl Freeze for DateTimeFormatterOptions
impl RefUnwindSafe for DateTimeFormatterOptions
impl Send for DateTimeFormatterOptions
impl Sync for DateTimeFormatterOptions
impl Unpin for DateTimeFormatterOptions
impl UnwindSafe for DateTimeFormatterOptions
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more