pub struct IanaToBcp47Map<'data> {
pub map: ZeroAsciiIgnoreCaseTrie<ZeroVec<'data, u8>>,
pub bcp47_ids: ZeroVec<'data, TimeZone>,
}
Expand description
A mapping from normal-case IANA time zone identifiers to BCP-47 time zone identifiers.
Multiple IANA time zone IDs can map to the same BCP-47 time zone ID.
🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. While the serde representation of data structs is guaranteed
to be stable, their Rust representation might not be. Use with caution.
Fields§
§map: ZeroAsciiIgnoreCaseTrie<ZeroVec<'data, u8>>
A map from normal-case IANA time zone identifiers to indexes of BCP-47 time zone identifiers along with a canonical flag. The IANA identifiers are normal-case.
The usize
values stored in the trie have the following form:
- Lowest bit: 1 if canonical, 0 if not canonical
- All remaining bits: index into
bcp47_ids
For example, in CLDR 44, "Africa/Abidjan"
has value 221, which means it is canonical
(low bit is 1 == odd number) and the index into bcp47_ids
is 110 (221 >> 1).
bcp47_ids: ZeroVec<'data, TimeZone>
A list of BCP-47 time zone identifiers, sorted by canonical IANA ID.
Trait Implementations§
Source§impl<'data> Bake for IanaToBcp47Map<'data>
impl<'data> Bake for IanaToBcp47Map<'data>
Source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Source§impl<'data> BakeSize for IanaToBcp47Map<'data>
impl<'data> BakeSize for IanaToBcp47Map<'data>
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl<'data> Clone for IanaToBcp47Map<'data>
impl<'data> Clone for IanaToBcp47Map<'data>
Source§fn clone(&self) -> IanaToBcp47Map<'data>
fn clone(&self) -> IanaToBcp47Map<'data>
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<'data> Debug for IanaToBcp47Map<'data>
impl<'data> Debug for IanaToBcp47Map<'data>
Source§impl<'de, 'data> Deserialize<'de> for IanaToBcp47Map<'data>where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for IanaToBcp47Map<'data>where
'de: 'data,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IanaToBcp47Map<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IanaToBcp47Map<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MaybeAsVarULE for IanaToBcp47Map<'_>
impl MaybeAsVarULE for IanaToBcp47Map<'_>
Source§impl MaybeEncodeAsVarULE for IanaToBcp47Map<'_>
impl MaybeEncodeAsVarULE for IanaToBcp47Map<'_>
Source§fn maybe_encode_as_varule(
&self,
) -> Option<&<IanaToBcp47Map<'_> as MaybeAsVarULE>::EncodedStruct>
fn maybe_encode_as_varule( &self, ) -> Option<&<IanaToBcp47Map<'_> as MaybeAsVarULE>::EncodedStruct>
Returns the
MaybeAsVarULE::EncodedStruct
that represents this data struct,
or None
if the data struct does not support this representation.Source§impl<'data> PartialEq for IanaToBcp47Map<'data>
impl<'data> PartialEq for IanaToBcp47Map<'data>
Source§impl<'data> Serialize for IanaToBcp47Map<'data>
impl<'data> Serialize for IanaToBcp47Map<'data>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'a> Yokeable<'a> for IanaToBcp47Map<'static>
impl<'a> Yokeable<'a> for IanaToBcp47Map<'static>
Source§type Output = IanaToBcp47Map<'a>
type Output = IanaToBcp47Map<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
Source§fn transform_owned(self) -> <IanaToBcp47Map<'static> as Yokeable<'a>>::Output
fn transform_owned(self) -> <IanaToBcp47Map<'static> as Yokeable<'a>>::Output
Source§unsafe fn make(
this: <IanaToBcp47Map<'static> as Yokeable<'a>>::Output,
) -> IanaToBcp47Map<'static>
unsafe fn make( this: <IanaToBcp47Map<'static> as Yokeable<'a>>::Output, ) -> IanaToBcp47Map<'static>
This method can be used to cast away
Self<'a>
’s lifetime. Read moreSource§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreSource§impl<'zf, 'zf_inner> ZeroFrom<'zf, IanaToBcp47Map<'zf_inner>> for IanaToBcp47Map<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, IanaToBcp47Map<'zf_inner>> for IanaToBcp47Map<'zf>
Source§fn zero_from(this: &'zf IanaToBcp47Map<'zf_inner>) -> IanaToBcp47Map<'zf>
fn zero_from(this: &'zf IanaToBcp47Map<'zf_inner>) -> IanaToBcp47Map<'zf>
Clone the other
C
into a struct that may retain references into C
.impl<'data> StructuralPartialEq for IanaToBcp47Map<'data>
Auto Trait Implementations§
impl<'data> Freeze for IanaToBcp47Map<'data>
impl<'data> RefUnwindSafe for IanaToBcp47Map<'data>
impl<'data> Send for IanaToBcp47Map<'data>
impl<'data> Sync for IanaToBcp47Map<'data>
impl<'data> Unpin for IanaToBcp47Map<'data>
impl<'data> UnwindSafe for IanaToBcp47Map<'data>
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§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