Struct icu_datetime::options::preferences::Bag
source ยท #[non_exhaustive]pub struct Bag {
pub hour_cycle: Option<HourCycle>,
}
Expand description
Stores user preferences which may affect the result of date and time formatting.
๐ง 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
ยงExamples
use icu::datetime::options::preferences;
let prefs = preferences::Bag::from_hour_cycle(preferences::HourCycle::H23);
Fields (Non-exhaustive)ยง
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.hour_cycle: Option<HourCycle>
The hour cycle can be adjusts according to user preferences, for instance at the OS-level. That preference can be applied here to change the hour cycle from the default for the given locale.
Implementationsยง
sourceยงimpl Bag
impl Bag
sourcepub(crate) fn from_data_locale(data_locale: &DataLocale) -> Self
pub(crate) fn from_data_locale(data_locale: &DataLocale) -> Self
Construct a Bag
from a given DataLocale
Trait Implementationsยง
impl Copy for Bag
impl Eq for Bag
impl StructuralPartialEq for Bag
Auto Trait Implementationsยง
impl Freeze for Bag
impl RefUnwindSafe for Bag
impl Send for Bag
impl Sync for Bag
impl Unpin for Bag
impl UnwindSafe for Bag
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