Unit

Enum Unit 

Source
pub enum Unit {
Show 124 variants TemperatureCelcius, TemperatureKelvin, TemperatureFahrenheit, HumidityPercentage, BatteryPercentage, LightLux, PressureHectoPascal, EnergyKiloWattHour, SignalStrengthDbm, TimeMilliseconds, TimeSeconds, TimeMinutes, TimeHours, TimeDays, PowerWatt, PowerKiloWatt, VoltageVolt, CurrentAmpere, DistanceMillimeter, DistanceCentimeter, DistanceMeter, DistanceKilometer, CurrencyUSD, CurrencyEUR, CurrencyGBP, CurrencyJPY, CurrencyCNY, CurrencyCAD, CurrencyAUD, CurrencyCHF, CurrencyINR, CurrencyBRL, CurrencyDollar, CurrencyEuro, CurrencyPound, CurrencyYen, CurrencyCent, NumberJoule, NumberKiloJoule, NumberMegaJoule, NumberGigaJoule, NumberMilliWattHour, NumberWattHour, NumberKiloWattHour, NumberMegaWattHour, NumberGigaWattHour, NumberTeraWattHour, NumberCalorie, NumberKiloCalorie, NumberMegaCalorie, NumberGigaCalorie, NumberCelsius, NumberFahrenheit, NumberKelvin, NumberMilliPascal, NumberPascal, NumberHectoPascal, NumberKiloPascal, NumberBar, NumberCentiBar, NumberMilliBar, NumberMillimeterMercury, NumberInchMercury, NumberInchWater, NumberPsi, NumberLiter, NumberMilliLiter, NumberGallon, NumberFluidOunce, NumberCubicMeter, NumberCubicFoot, NumberCCF, NumberMCF, NumberFeetPerSecond, NumberInchPerDay, NumberInchPerHour, NumberInchPerSecond, NumberKilometerPerHour, NumberKnot, NumberMeterPerSecond, NumberMilePerHour, NumberMillimeterPerDay, NumberMillimeterPerSecond, NumberKilometer, NumberMeter, NumberCentimeter, NumberMillimeter, NumberMile, NumberNauticalMile, NumberYard, NumberInch, NumberMilliWatt, NumberWatt, NumberKiloWatt, NumberMegaWatt, NumberGigaWatt, NumberTeraWatt, NumberAmpere, NumberMilliAmpere, NumberVolt, NumberMilliVolt, NumberMicroVolt, NumberKiloVolt, NumberMegaVolt, NumberBitPerSecond, NumberKiloBitPerSecond, NumberMegaBitPerSecond, NumberGigaBitPerSecond, NumberBytePerSecond, NumberKiloBytePerSecond, NumberMegaBytePerSecond, NumberGigaBytePerSecond, NumberKibiBytePerSecond, NumberMebiBytePerSecond, NumberGibiBytePerSecond, NumberKilogram, NumberGram, NumberMilligram, NumberMicrogram, NumberOunce, NumberPound, NumberStone, NumberPercentage, Other(&'static str),
}

Variants§

§

TemperatureCelcius

§

TemperatureKelvin

§

TemperatureFahrenheit

§

HumidityPercentage

§

BatteryPercentage

§

LightLux

§

PressureHectoPascal

§

EnergyKiloWattHour

§

SignalStrengthDbm

§

TimeMilliseconds

§

TimeSeconds

§

TimeMinutes

§

TimeHours

§

TimeDays

§

PowerWatt

§

PowerKiloWatt

§

VoltageVolt

§

CurrentAmpere

§

DistanceMillimeter

§

DistanceCentimeter

§

DistanceMeter

§

DistanceKilometer

§

CurrencyUSD

§

CurrencyEUR

§

CurrencyGBP

§

CurrencyJPY

§

CurrencyCNY

§

CurrencyCAD

§

CurrencyAUD

§

CurrencyCHF

§

CurrencyINR

§

CurrencyBRL

§

CurrencyDollar

§

CurrencyEuro

§

CurrencyPound

§

CurrencyYen

§

CurrencyCent

§

NumberJoule

§

NumberKiloJoule

§

NumberMegaJoule

§

NumberGigaJoule

§

NumberMilliWattHour

§

NumberWattHour

§

NumberKiloWattHour

§

NumberMegaWattHour

§

NumberGigaWattHour

§

NumberTeraWattHour

§

NumberCalorie

§

NumberKiloCalorie

§

NumberMegaCalorie

§

NumberGigaCalorie

§

NumberCelsius

§

NumberFahrenheit

§

NumberKelvin

§

NumberMilliPascal

§

NumberPascal

§

NumberHectoPascal

§

NumberKiloPascal

§

NumberBar

§

NumberCentiBar

§

NumberMilliBar

§

NumberMillimeterMercury

§

NumberInchMercury

§

NumberInchWater

§

NumberPsi

§

NumberLiter

§

NumberMilliLiter

§

NumberGallon

§

NumberFluidOunce

§

NumberCubicMeter

§

NumberCubicFoot

§

NumberCCF

§

NumberMCF

§

NumberFeetPerSecond

§

NumberInchPerDay

§

NumberInchPerHour

§

NumberInchPerSecond

§

NumberKilometerPerHour

§

NumberKnot

§

NumberMeterPerSecond

§

NumberMilePerHour

§

NumberMillimeterPerDay

§

NumberMillimeterPerSecond

§

NumberKilometer

§

NumberMeter

§

NumberCentimeter

§

NumberMillimeter

§

NumberMile

§

NumberNauticalMile

§

NumberYard

§

NumberInch

§

NumberMilliWatt

§

NumberWatt

§

NumberKiloWatt

§

NumberMegaWatt

§

NumberGigaWatt

§

NumberTeraWatt

§

NumberAmpere

§

NumberMilliAmpere

§

NumberVolt

§

NumberMilliVolt

§

NumberMicroVolt

§

NumberKiloVolt

§

NumberMegaVolt

§

NumberBitPerSecond

§

NumberKiloBitPerSecond

§

NumberMegaBitPerSecond

§

NumberGigaBitPerSecond

§

NumberBytePerSecond

§

NumberKiloBytePerSecond

§

NumberMegaBytePerSecond

§

NumberGigaBytePerSecond

§

NumberKibiBytePerSecond

§

NumberMebiBytePerSecond

§

NumberGibiBytePerSecond

§

NumberKilogram

§

NumberGram

§

NumberMilligram

§

NumberMicrogram

§

NumberOunce

§

NumberPound

§

NumberStone

§

NumberPercentage

§

Other(&'static str)

Implementations§

Source§

impl Unit

Source

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

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<BatteryUnit> for Unit

Source§

fn from(unit: BatteryUnit) -> Self

Converts to this type from the input type.
Source§

impl From<CurrencyUnit> for Unit

Source§

fn from(unit: CurrencyUnit) -> Self

Converts to this type from the input type.
Source§

impl From<CurrentUnit> for Unit

Source§

fn from(unit: CurrentUnit) -> Self

Converts to this type from the input type.
Source§

impl From<DistanceUnit> for Unit

Source§

fn from(unit: DistanceUnit) -> Self

Converts to this type from the input type.
Source§

impl From<EnergyUnit> for Unit

Source§

fn from(unit: EnergyUnit) -> Self

Converts to this type from the input type.
Source§

impl From<HumidityUnit> for Unit

Source§

fn from(unit: HumidityUnit) -> Self

Converts to this type from the input type.
Source§

impl From<LightUnit> for Unit

Source§

fn from(unit: LightUnit) -> Self

Converts to this type from the input type.
Source§

impl From<NumberUnit> for Unit

Source§

fn from(unit: NumberUnit) -> Self

Converts to this type from the input type.
Source§

impl From<PowerUnit> for Unit

Source§

fn from(unit: PowerUnit) -> Self

Converts to this type from the input type.
Source§

impl From<PressureUnit> for Unit

Source§

fn from(unit: PressureUnit) -> Self

Converts to this type from the input type.
Source§

impl From<SignalStrengthUnit> for Unit

Source§

fn from(unit: SignalStrengthUnit) -> Self

Converts to this type from the input type.
Source§

impl From<TemperatureUnit> for Unit

Source§

fn from(unit: TemperatureUnit) -> Self

Converts to this type from the input type.
Source§

impl From<TimeUnit> for Unit

Source§

fn from(unit: TimeUnit) -> Self

Converts to this type from the input type.
Source§

impl From<VoltageUnit> for Unit

Source§

fn from(unit: VoltageUnit) -> 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 TryFrom<Unit> for BatteryUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for CurrencyUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for CurrentUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for DistanceUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for EnergyUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for HumidityUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for LightUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for NumberUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for PowerUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for PressureUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for SignalStrengthUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for TemperatureUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for TimeUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Unit> for VoltageUnit

Source§

type Error = UnitConversionError

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

fn try_from(unit: Unit) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Unit

Source§

impl Eq 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, 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.