Struct icu::timezone::WindowsTimeZoneMapper
source · pub struct WindowsTimeZoneMapper { /* private fields */ }
Expand description
A mapper between Windows time zone identifier and a BCP-47 ID.
This mapper currently only supports mapping from windows time zone identifiers to BCP-47 identifiers.
A windows time zone may vary depending on an associated territory/region. This is represented by the internal data mapping by delimiting the windows time zone and territory/region code with a “/”.
For instance, Central Standard Time can vary depending on the provided regions listed below:
- Central Standard Time/001
- Central Standard Time/US
- Central Standard Time/CA
- Central Standard Time/MX
- Central Standard Time/ZZ
As such, a Region
may be provided to further specify a desired territory/region when
querying a BCP-47 identifier. If no region is provided or the specificity is not required,
then the territory will default to the M.49 World Code, 001
.
Implementations§
source§impl WindowsTimeZoneMapper
impl WindowsTimeZoneMapper
sourcepub fn new() -> WindowsTimeZoneMapperBorrowed<'static>
pub fn new() -> WindowsTimeZoneMapperBorrowed<'static>
Creates a new static WindowsTimeZoneMapperBorrowed
.
sourcepub fn try_new_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
) -> Result<WindowsTimeZoneMapper, DataError>
pub fn try_new_with_any_provider( provider: &(impl AnyProvider + ?Sized), ) -> Result<WindowsTimeZoneMapper, DataError>
A version of [Self :: new
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
) -> Result<WindowsTimeZoneMapper, DataError>
pub fn try_new_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), ) -> Result<WindowsTimeZoneMapper, DataError>
A version of [Self :: new
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
sourcepub fn try_new_unstable<P>(
provider: &P,
) -> Result<WindowsTimeZoneMapper, DataError>
pub fn try_new_unstable<P>( provider: &P, ) -> Result<WindowsTimeZoneMapper, DataError>
A version of Self::new
that uses custom data provided by a DataProvider
.
sourcepub fn as_borrowed(&self) -> WindowsTimeZoneMapperBorrowed<'_>
pub fn as_borrowed(&self) -> WindowsTimeZoneMapperBorrowed<'_>
Returns the borrowed version of the mapper that can be queried from the owned mapper.
Using the borrowed version allows one to avoid a small potential indirection cost when querying the mapper from the owned version.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowsTimeZoneMapper
impl RefUnwindSafe for WindowsTimeZoneMapper
impl Send for WindowsTimeZoneMapper
impl Sync for WindowsTimeZoneMapper
impl Unpin for WindowsTimeZoneMapper
impl UnwindSafe for WindowsTimeZoneMapper
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
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>
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>
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