Struct icu_experimental::measure::provider::single_unit::SingleUnit
source · pub struct SingleUnit {
pub power: i8,
pub si_prefix: SiPrefix,
pub unit_id: u16,
}
Expand description
Represents a single unit in a measure unit.
For example, the MeasureUnit kilometer-per-square-second
contains two single units:
kilometer
with power 1 and prefix 3 with base 10.second
with power -2 and prefix power equal to 0.
Fields§
§power: i8
The power of the unit.
si_prefix: SiPrefix
The si base of the unit.
unit_id: u16
The id of the unit.
Trait Implementations§
source§impl AsULE for SingleUnit
impl AsULE for SingleUnit
source§type ULE = SingleUnitULE
type ULE = SingleUnitULE
The ULE type corresponding to
Self
. Read moresource§fn to_unaligned(self) -> Self::ULE
fn to_unaligned(self) -> Self::ULE
source§fn from_unaligned(unaligned: Self::ULE) -> Self
fn from_unaligned(unaligned: Self::ULE) -> Self
source§impl Bake for SingleUnit
impl Bake for SingleUnit
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl BakeSize for SingleUnit
impl BakeSize for SingleUnit
source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
source§impl Clone for SingleUnit
impl Clone for SingleUnit
source§fn clone(&self) -> SingleUnit
fn clone(&self) -> SingleUnit
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 Debug for SingleUnit
impl Debug for SingleUnit
source§impl Default for SingleUnit
impl Default for SingleUnit
source§fn default() -> SingleUnit
fn default() -> SingleUnit
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for SingleUnit
impl<'de> Deserialize<'de> for SingleUnit
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 Ord for SingleUnit
impl Ord for SingleUnit
source§fn cmp(&self, other: &SingleUnit) -> Ordering
fn cmp(&self, other: &SingleUnit) -> 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 PartialEq for SingleUnit
impl PartialEq for SingleUnit
source§impl PartialOrd for SingleUnit
impl PartialOrd for SingleUnit
source§impl Serialize for SingleUnit
impl Serialize for SingleUnit
source§impl<'a> ZeroMapKV<'a> for SingleUnit
impl<'a> ZeroMapKV<'a> for SingleUnit
source§type Container = ZeroVec<'a, SingleUnit>
type Container = ZeroVec<'a, SingleUnit>
The container that can be used with this type: [
ZeroVec
] or [VarZeroVec
].type Slice = ZeroSlice<SingleUnit>
source§type GetType = SingleUnitULE
type GetType = SingleUnitULE
The type produced by
Container::get()
Read moresource§type OwnedType = SingleUnit
type OwnedType = SingleUnit
The type produced by
Container::replace()
and Container::remove()
,
also used during deserialization. If Self
is human readable serialized,
deserializing to Self::OwnedType
should produce the same value once
passed through Self::owned_as_self()
Read moreimpl Copy for SingleUnit
impl Eq for SingleUnit
impl StructuralPartialEq for SingleUnit
Auto Trait Implementations§
impl Freeze for SingleUnit
impl RefUnwindSafe for SingleUnit
impl Send for SingleUnit
impl Sync for SingleUnit
impl Unpin for SingleUnit
impl UnwindSafe for SingleUnit
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