Struct icu::experimental::units::provider::ConversionInfo
source · pub struct ConversionInfo<'data> {
pub basic_units: ZeroVec<'data, SingleUnit>,
pub factor_num: ZeroVec<'data, u8>,
pub factor_den: ZeroVec<'data, u8>,
pub factor_sign: Sign,
pub offset_num: ZeroVec<'data, u8>,
pub offset_den: ZeroVec<'data, u8>,
pub offset_sign: Sign,
pub exactness: Exactness,
}
Expand description
Represents the conversion information for a unit. Which includes the base unit (the unit which the unit is converted to), the conversion factor, and the offset.
Fields§
§basic_units: ZeroVec<'data, SingleUnit>
Contains the base unit (after parsing) which what the unit is converted to.
factor_num: ZeroVec<'data, u8>
Represents the numerator of the conversion factor.
factor_den: ZeroVec<'data, u8>
Represents the denominator of the conversion factor.
factor_sign: Sign
Represents the sign of the conversion factor.
offset_num: ZeroVec<'data, u8>
Represents the numerator of the offset.
offset_den: ZeroVec<'data, u8>
Represents the denominator of the offset.
offset_sign: Sign
Represents the sign of the offset.
exactness: Exactness
Represents the exactness of the conversion factor.
Trait Implementations§
source§impl<'data> Bake for ConversionInfo<'data>
impl<'data> Bake for ConversionInfo<'data>
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl<'data> BakeSize for ConversionInfo<'data>
impl<'data> BakeSize for ConversionInfo<'data>
source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
source§impl<'data> Clone for ConversionInfo<'data>
impl<'data> Clone for ConversionInfo<'data>
source§fn clone(&self) -> ConversionInfo<'data>
fn clone(&self) -> ConversionInfo<'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 ConversionInfo<'data>
impl<'data> Debug for ConversionInfo<'data>
source§impl<'data> Default for ConversionInfo<'data>
impl<'data> Default for ConversionInfo<'data>
source§fn default() -> ConversionInfo<'data>
fn default() -> ConversionInfo<'data>
Returns the “default value” for a type. Read more
source§impl<'de, 'data> Deserialize<'de> for ConversionInfo<'data>where
'de: 'data,
impl<'de, 'data> Deserialize<'de> for ConversionInfo<'data>where
'de: 'data,
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConversionInfo<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConversionInfo<'data>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'data> EncodeAsVarULE<ConversionInfoULE> for &ConversionInfo<'data>
impl<'data> EncodeAsVarULE<ConversionInfoULE> for &ConversionInfo<'data>
source§fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
Calls
cb
with a piecewise list of byte slices that when concatenated
produce the memory pattern of the corresponding instance of T
. Read moresource§fn encode_var_ule_len(&self) -> usize
fn encode_var_ule_len(&self) -> usize
Return the length, in bytes, of the corresponding
VarULE
typesource§fn encode_var_ule_write(&self, dst: &mut [u8])
fn encode_var_ule_write(&self, dst: &mut [u8])
Write the corresponding
VarULE
type to the dst
buffer. dst
should
be the size of Self::encode_var_ule_len()
source§impl<'data> EncodeAsVarULE<ConversionInfoULE> for ConversionInfo<'data>
impl<'data> EncodeAsVarULE<ConversionInfoULE> for ConversionInfo<'data>
source§fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
fn encode_var_ule_as_slices<R>(&self, cb: impl FnOnce(&[&[u8]]) -> R) -> R
Calls
cb
with a piecewise list of byte slices that when concatenated
produce the memory pattern of the corresponding instance of T
. Read moresource§fn encode_var_ule_len(&self) -> usize
fn encode_var_ule_len(&self) -> usize
Return the length, in bytes, of the corresponding
VarULE
typesource§fn encode_var_ule_write(&self, dst: &mut [u8])
fn encode_var_ule_write(&self, dst: &mut [u8])
Write the corresponding
VarULE
type to the dst
buffer. dst
should
be the size of Self::encode_var_ule_len()
source§impl<'data> Ord for ConversionInfo<'data>
impl<'data> Ord for ConversionInfo<'data>
source§fn cmp(&self, other: &ConversionInfo<'data>) -> Ordering
fn cmp(&self, other: &ConversionInfo<'data>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'data> PartialEq for ConversionInfo<'data>
impl<'data> PartialEq for ConversionInfo<'data>
source§impl<'data> PartialOrd for ConversionInfo<'data>
impl<'data> PartialOrd for ConversionInfo<'data>
source§impl<'data> Serialize for ConversionInfo<'data>
impl<'data> Serialize for ConversionInfo<'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<'data> ZeroFrom<'data, ConversionInfoULE> for ConversionInfo<'data>
impl<'data> ZeroFrom<'data, ConversionInfoULE> for ConversionInfo<'data>
source§fn zero_from(other: &'data ConversionInfoULE) -> ConversionInfo<'data>
fn zero_from(other: &'data ConversionInfoULE) -> ConversionInfo<'data>
Clone the other
C
into a struct that may retain references into C
.impl<'data> Eq for ConversionInfo<'data>
impl<'data> StructuralPartialEq for ConversionInfo<'data>
Auto Trait Implementations§
impl<'data> Freeze for ConversionInfo<'data>
impl<'data> RefUnwindSafe for ConversionInfo<'data>
impl<'data> Send for ConversionInfo<'data>
impl<'data> Sync for ConversionInfo<'data>
impl<'data> Unpin for ConversionInfo<'data>
impl<'data> UnwindSafe for ConversionInfo<'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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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