Enum Unit

Source
#[repr(u8)]
pub enum Unit {
Show 93 variants Unspecified = 0, DegreesCelcius = 1, DegreesFahrenheit = 2, DegreesKelvin = 3, Volt = 4, Amp = 5, Watt = 6, Joule = 7, Coulomb = 8, VoltAmpere = 9, Nit = 10, Lumen = 11, Lux = 12, Candela = 13, KiloPascal = 14, PoundsPerSquareInch = 15, Newton = 16, CubicFeetPerMinute = 17, RevolutionsPerMinute = 18, Hertz = 19, Microsecond = 20, Millisecond = 21, Second = 22, Minute = 23, Hour = 24, Day = 25, Week = 26, Mil = 27, Inch = 28, Foot = 29, CubicInch = 30, CubicFoot = 31, Millimeter = 32, Centimeter = 33, Meter = 34, CubicCentimeter = 35, CubicMeter = 36, Liter = 37, FluidOunce = 38, Radian = 39, Steradian = 40, Revolution = 41, Cycle = 42, Gravity = 43, Ounce = 44, Pound = 45, FootPound = 46, OunceInch = 47, Gauss = 48, Gilbert = 49, Henry = 50, Millihenry = 51, Farad = 52, Microfarad = 53, Ohm = 54, Siemens = 55, Mole = 56, Becquerel = 57, PartsPerMillion = 58, Decibel = 60, AWeightedDecibel = 61, CWeightedDecibel = 62, Gray = 63, Sievert = 64, ColorTemperatureDegreesKelvin = 65, Bit = 66, Kilobit = 67, Megabit = 68, Gigabit = 69, Byte = 70, Kilobyte = 71, Megabyte = 72, Gigabyte = 73, Word = 74, DoubleWord = 75, QuadWord = 76, CacheLine = 77, Hit = 78, Miss = 79, Retry = 80, Reset = 81, OverrunOrUnderflow = 82, Underrun = 83, Collision = 84, Packet = 85, Message = 86, Character = 87, Error = 88, CorrectableError = 89, UncorrectableError = 90, FatalError = 91, Gram = 92, Unknown(u8),
}

Variants§

§

Unspecified = 0

§

DegreesCelcius = 1

§

DegreesFahrenheit = 2

§

DegreesKelvin = 3

§

Volt = 4

§

Amp = 5

§

Watt = 6

§

Joule = 7

§

Coulomb = 8

§

VoltAmpere = 9

§

Nit = 10

§

Lumen = 11

§

Lux = 12

§

Candela = 13

§

KiloPascal = 14

§

PoundsPerSquareInch = 15

§

Newton = 16

§

CubicFeetPerMinute = 17

§

RevolutionsPerMinute = 18

§

Hertz = 19

§

Microsecond = 20

§

Millisecond = 21

§

Second = 22

§

Minute = 23

§

Hour = 24

§

Day = 25

§

Week = 26

§

Mil = 27

§

Inch = 28

§

Foot = 29

§

CubicInch = 30

§

CubicFoot = 31

§

Millimeter = 32

§

Centimeter = 33

§

Meter = 34

§

CubicCentimeter = 35

§

CubicMeter = 36

§

Liter = 37

§

FluidOunce = 38

§

Radian = 39

§

Steradian = 40

§

Revolution = 41

§

Cycle = 42

§

Gravity = 43

§

Ounce = 44

§

Pound = 45

§

FootPound = 46

§

OunceInch = 47

§

Gauss = 48

§

Gilbert = 49

§

Henry = 50

§

Millihenry = 51

§

Farad = 52

§

Microfarad = 53

§

Ohm = 54

§

Siemens = 55

§

Mole = 56

§

Becquerel = 57

§

PartsPerMillion = 58

§

Decibel = 60

§

AWeightedDecibel = 61

§

CWeightedDecibel = 62

§

Gray = 63

§

Sievert = 64

§

ColorTemperatureDegreesKelvin = 65

§

Bit = 66

§

Kilobit = 67

§

Megabit = 68

§

Gigabit = 69

§

Byte = 70

§

Kilobyte = 71

§

Megabyte = 72

§

Gigabyte = 73

§

Word = 74

§

DoubleWord = 75

§

QuadWord = 76

§

CacheLine = 77

§

Hit = 78

§

Miss = 79

§

Retry = 80

§

Reset = 81

§

OverrunOrUnderflow = 82

§

Underrun = 83

§

Collision = 84

§

Packet = 85

§

Message = 86

§

Character = 87

§

Error = 88

§

CorrectableError = 89

§

UncorrectableError = 90

§

FatalError = 91

§

Gram = 92

§

Unknown(u8)

Implementations§

Source§

impl Unit

Source

pub fn display<T>(&self, short: bool, value: T) -> String
where T: IsPlural + Display,

Trait Implementations§

Source§

impl Clone for Unit

Source§

fn clone(&self) -> Unit

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Unit

Source§

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

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

impl From<Unit> for u8

Source§

fn from(value: Unit) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Unit

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Unit

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Unit

Source§

impl StructuralPartialEq for Unit

Auto Trait Implementations§

§

impl Freeze for Unit

§

impl RefUnwindSafe for Unit

§

impl Send for Unit

§

impl Sync for Unit

§

impl Unpin for Unit

§

impl UnwindSafe for Unit

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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V