pub struct UnitsInfo<'data> {
pub units_conversion_trie: ZeroTrieSimpleAscii<ZeroVec<'data, u8>>,
pub convert_infos: VarZeroVec<'data, ConversionInfoULE>,
}
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§
§units_conversion_trie: ZeroTrieSimpleAscii<ZeroVec<'data, u8>>
Maps from unit name (e.g. foot) to it is conversion information.
convert_infos: VarZeroVec<'data, ConversionInfoULE>
Contains the conversion information, such as the conversion rate and the base unit.
For example, the conversion information for the unit foot
is 1 foot = 0.3048 meter
.
Trait Implementations§
Source§impl<'data> BakeSize for UnitsInfo<'data>
impl<'data> BakeSize for UnitsInfo<'data>
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl<'de: 'data, 'data> Deserialize<'de> for UnitsInfo<'data>
impl<'de: 'data, 'data> Deserialize<'de> for UnitsInfo<'data>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MaybeAsVarULE for UnitsInfo<'_>
impl MaybeAsVarULE for UnitsInfo<'_>
Source§type EncodedStruct = [()]
type EncodedStruct = [()]
The [
VarULE
] type for this data struct, or [()]
if it cannot be represented as [VarULE
].Source§impl MaybeEncodeAsVarULE for UnitsInfo<'_>
impl MaybeEncodeAsVarULE for UnitsInfo<'_>
Source§fn maybe_encode_as_varule(&self) -> Option<&Self::EncodedStruct>
fn maybe_encode_as_varule(&self) -> Option<&Self::EncodedStruct>
Returns the [
MaybeAsVarULE::EncodedStruct
] that represents this data struct,
or None
if the data struct does not support this representation.Source§impl<'a> Yokeable<'a> for UnitsInfo<'static>
impl<'a> Yokeable<'a> for UnitsInfo<'static>
Source§type Output = UnitsInfo<'a>
type Output = UnitsInfo<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
Source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
Source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moreSource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreimpl<'data> StructuralPartialEq for UnitsInfo<'data>
Auto Trait Implementations§
impl<'data> Freeze for UnitsInfo<'data>
impl<'data> RefUnwindSafe for UnitsInfo<'data>
impl<'data> Send for UnitsInfo<'data>
impl<'data> Sync for UnitsInfo<'data>
impl<'data> Unpin for UnitsInfo<'data>
impl<'data> UnwindSafe for UnitsInfo<'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