Skip to main content

UnitMultiplier

Enum UnitMultiplier 

Source
pub enum UnitMultiplier {
Show 21 variants y, z, a, f, p, n, micro, m, c, d, none, da, h, k, M, G, T, P, E, Z, Y,
}
Expand description

The unit multipliers defined for the CIM. When applied to unit symbols, the unit symbol is treated as a derived unit. Regardless of the contents of the unit symbol text, the unit symbol shall be treated as if it were a single-character unit symbol. Unit symbols should not contain multipliers, and it should be left to the multiplier to define the multiple for an entire data type. For example, if a unit symbol is ‘m2Pers’ and the multiplier is ‘k’, then the value is k(m**2/s), and the multiplier applies to the entire final value, not to any individual part of the value. This can be conceptualized by substituting a derived unit symbol for the unit type. If one imagines that the symbol ‘Þ’ represents the derived unit ‘m2Pers’, then applying the multiplier ‘k’ can be conceptualized simply as ‘kÞ’. For example, the SI unit for mass is ‘kg’ and not ‘g’. If the unit symbol is defined as ‘kg’, then the multiplier is applied to ‘kg’ as a whole and does not replace the ‘k’ in front of the ‘g’. In this case, the multiplier of ‘m’ would be used with the unit symbol of ‘kg’ to represent one gram. As a text string, this violates the instructions in IEC 80000-1. However, because the unit symbol in CIM is treated as a derived unit instead of as an SI unit, it makes more sense to conceptualize the ‘kg’ as if it were replaced by one of the proposed replacements for the SI mass symbol. If one imagines that the ‘kg’ were replaced by a symbol ‘Þ’, then it is easier to conceptualize the multiplier ‘m’ as creating the proper unit ‘mÞ’, and not the forbidden unit ‘mkg’.

Variants§

§

y

Yocto 10**-24.

§

z

Zepto 10**-21.

§

a

Atto 10**-18.

§

f

Femto 10**-15.

§

p

Pico 10**-12.

§

n

Nano 10**-9.

§

micro

Micro 10**-6.

§

m

Milli 10**-3.

§

c

Centi 10**-2.

§

d

Deci 10**-1.

§

none

No multiplier or equivalently multiply by 1.

§

da

Deca 10**1.

§

h

Hecto 10**2.

§

k

Kilo 10**3.

§

M

Mega 10**6.

§

G

Giga 10**9.

§

T

Tera 10**12.

§

P

Peta 10**15.

§

E

Exa 10**18.

§

Z

Zetta 10**21.

§

Y

Yotta 10**24.

Implementations§

Source§

impl UnitMultiplier

Source

pub fn uri(&self) -> &'static str

Trait Implementations§

Source§

impl Clone for UnitMultiplier

Source§

fn clone(&self) -> UnitMultiplier

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UnitMultiplier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UnitMultiplier

Source§

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 PartialEq for UnitMultiplier

Source§

fn eq(&self, other: &UnitMultiplier) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for UnitMultiplier

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for UnitMultiplier

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.