pub struct UnitsTrie<'data> {
pub trie: ZeroTrieSimpleAscii<ZeroVec<'data, u8>>,
}
Expand description
This type encapsulates all the constant data required for unit conversions.
🚧 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§
§trie: ZeroTrieSimpleAscii<ZeroVec<'data, u8>>
Maps from unit name (e.g. foot or meter) to its unit id. this id can be used to retrieve the conversion information from the UnitsInfo
.
Trait Implementations§
Source§impl<'data> BakeSize for UnitsTrie<'data>
impl<'data> BakeSize for UnitsTrie<'data>
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl<'de, 'data> Deserialize<'de> for UnitsTrie<'data>where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for UnitsTrie<'data>where
'de: 'data,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnitsTrie<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnitsTrie<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MaybeAsVarULE for UnitsTrie<'_>
impl MaybeAsVarULE for UnitsTrie<'_>
Source§impl MaybeEncodeAsVarULE for UnitsTrie<'_>
impl MaybeEncodeAsVarULE for UnitsTrie<'_>
Source§fn maybe_encode_as_varule(
&self,
) -> Option<&<UnitsTrie<'_> as MaybeAsVarULE>::EncodedStruct>
fn maybe_encode_as_varule( &self, ) -> Option<&<UnitsTrie<'_> 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> Serialize for UnitsTrie<'data>
impl<'data> Serialize for UnitsTrie<'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 UnitsTrie<'static>
impl<'a> Yokeable<'a> for UnitsTrie<'static>
Source§type Output = UnitsTrie<'a>
type Output = UnitsTrie<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
impl<'data> StructuralPartialEq for UnitsTrie<'data>
Auto Trait Implementations§
impl<'data> Freeze for UnitsTrie<'data>
impl<'data> RefUnwindSafe for UnitsTrie<'data>
impl<'data> Send for UnitsTrie<'data>
impl<'data> Sync for UnitsTrie<'data>
impl<'data> Unpin for UnitsTrie<'data>
impl<'data> UnwindSafe for UnitsTrie<'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