pub struct WindowsParser { /* 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 WindowsParser
impl WindowsParser
Sourcepub fn new() -> WindowsParserBorrowed<'static>
pub fn new() -> WindowsParserBorrowed<'static>
Creates a new static WindowsParserBorrowed
.
Sourcepub fn try_new_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
) -> Result<Self, DataError>
pub fn try_new_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), ) -> Result<Self, 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<Self, DataError>where
P: DataProvider<TimeZoneWindowsV1> + ?Sized,
pub fn try_new_unstable<P>(provider: &P) -> Result<Self, DataError>where
P: DataProvider<TimeZoneWindowsV1> + ?Sized,
A version of Self::new
that uses custom data provided by a DataProvider
.
Sourcepub fn as_borrowed(&self) -> WindowsParserBorrowed<'_>
pub fn as_borrowed(&self) -> WindowsParserBorrowed<'_>
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 WindowsParser
impl RefUnwindSafe for WindowsParser
impl Send for WindowsParser
impl Sync for WindowsParser
impl Unpin for WindowsParser
impl UnwindSafe for WindowsParser
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