pub enum ScalingByteExtension {
Show 89 variants NoUnit, Meter, Foot, Inch, Yard, EngMile, Gram, MetricTon, Second, Minute, Hour, Day, Year, Ampere, Volt, Coulomb, Ohm, Farad, Henry, Siemens, Weber, Tesla, Kelvin, Celsius, Fahrenheit, Candela, Radian, Degree, Hertz, Joule, Newton, Kilopond, PoundForce, Watt, MetricHorsePower, UsHorsePower, Pascal, Bar, Atmosphere, Psi, Becquerel, Lumen, Lux, Liter, UKGallon, USGallon, CubicInch, MeterPerSecond, KilometrePerHour, MilePerHour, RevolutionsPerSecond, RevolutionsPerMinute, Counts, Percent, MilligramsPerStroke, MeterPerSquareSecond, NewtonMeter, LiterPerMinute, WattPerSquareMeter, BarPerSecond, RadiansPerSecond, RadiansPerSquareSecond, KilogramsPerSquareMeter, Exa, Peta, Tera, Giga, Mega, Kilo, Hecto, Deca, Deci, Centi, Milli, Micro, Nano, Pico, Femto, Atto, Date1, Date2, Date3, Week, Time1, Time2, DateAndTime1, DateAndTime2, DateAndTime3, DateAndTime4,
}
Expand description

Scaling data byte extensions This enum is used to represent the following:

  1. Measurement units
  2. Format specifiers
  3. Unit scale prefixes

Due to this, each value specifies if it will return a Postfix or prefix. Use ScalingByteExtension::get_postfix to return the optional postfix of the scaling byte, or ScalingByteExtension::get_prefix to return the optional prefix of the scaling byte.

Variants§

§

NoUnit

No unit or presentation

§

Meter

Meter - Measure of length. Postfix: m

§

Foot

Foot - Measure of length. Postfix: ft

§

Inch

Inch - Measure of length. Postfix: in

§

Yard

Yard - Measure of length. Postfix: yd

§

EngMile

English mile - Measure of length. Postfix: mi

§

Gram

Gram - Measure of mass. Postfix: g

§

MetricTon

Metric ton - Measure of mass. Postfix: t

§

Second

Second - Measure of time. Postfix: s

§

Minute

Minute - Measure of time. Postfix: min

§

Hour

Hour - Measure of time. Postfix: h

§

Day

Day - Measure of time. Postfix: d

§

Year

Year - Measure of time. Postfix: y

§

Ampere

Ampere - Measure of electrical current. Postfix: A

§

Volt

Volt - Measure of electrical voltage. Postfix: V

§

Coulomb

Coulomb - Measure of electrical charge. Postfix: C

§

Ohm

Ohm - Measure of electrical resistance. Postfix: W

§

Farad

Farad - Measure of electrical capacitance. Postfix: F

§

Henry

Henry - Measure of electrical inductance. Postfix: H

§

Siemens

Siemens - Measure of electrical conductance. Postfix: S

§

Weber

Weber - Measure of magnetic flux. Postfix: Wb

§

Tesla

Tesla - Measure of magnetic flux density. Postfix: T

§

Kelvin

Kelvin - Measure of thermodynamic temperature. Postfix: K

§

Celsius

Kelvin - Measure of thermodynamic temperature. Postfix: °C

§

Fahrenheit

Kelvin - Measure of thermodynamic temperature. Postfix: °F

§

Candela

Candela - Measure of luminous intensity. Postfix: cd

§

Radian

Radians - Measure of plane angle. Postfix: Rad

§

Degree

Degrees - Measure of plane angle. Postfix: °

§

Hertz

Hertz - Measure of frequency. Postfix: Hz

§

Joule

Joule - Measure of energy. Postfix: J

§

Newton

Newton - Measure of force. Postfix: N

§

Kilopond

Kilo-pond - Measure of force. Postfix: kp

§

PoundForce

Pound force - Measure of force. Postfix: lbf

§

Watt

Watt - Measure of power. Postfix: W

§

MetricHorsePower

Metric horse power - Measure of power. Postfix: hk

§

UsHorsePower

US/UK Horse power - Measure of power. Postfix: hp

§

Pascal

Pascal - Measure of pressure. Postfix: Pa

§

Bar

Bar - Measure of pressure. Postfix: bar

§

Atmosphere

Atmosphere - Measure of pressure. Postfix: atm

§

Psi

Pound force per square inch - Measure of pressure. Postfix: psi

§

Becquerel

Becquerel - Measure of radioactivity. Postfix: Bq

§

Lumen

Lumen - Measure of light lux. Postfix: lm

§

Lux

Lux - Measure of illuminance. Postfix: lx

§

Liter

Liter - Measure of volume. Postfix: l

§

UKGallon

British gallon - Measure of volume. No Postfix or prefix is used

§

USGallon

US liquid gallon - Measure of volume. No Postfix or prefix is used

§

CubicInch

Cubic inch - Measure of volume. Postfix: cu in

§

MeterPerSecond

Meter per second - Measure of speed. Postfix: m/s

§

KilometrePerHour

Kilometers per hour - Measure of speed. Postfix: km/s

§

MilePerHour

Miles per hour - Measure of speed. Postfix: mph

§

RevolutionsPerSecond

Revolutions per second - Measure of angular velocity. Postfix: rps

§

RevolutionsPerMinute

Revolutions per minute - Measure of angular velocity. Postfix: rpm

§

Counts

Count. No Postfix or prefix is used

§

Percent

Percent. Postfix: %

§

MilligramsPerStroke

Milligrams per stroke - Measure of mass per engine stroke. Postfix: mg/stroke

§

MeterPerSquareSecond

Meters per square second - Measure of acceleration. Postfix: m/s2

§

NewtonMeter

Newton meter - Measure of torsion moment. Postfix: Nm

§

LiterPerMinute

Liters per minute - Measure of flow. Postfix: l/min

§

WattPerSquareMeter

Watts per square meter - Measure of intensity. Postfix: W/m2

§

BarPerSecond

Bar per second - Measure of pressure change. Postfix: bar/s

§

RadiansPerSecond

Radians per second - Measure of angular velocity. Postfix: rad/s2

§

RadiansPerSquareSecond

Radians per square second - Measure of angular acceleration. Postfix: rad/s2

§

KilogramsPerSquareMeter

Kilograms per square meter - Postfix: kg/m2

§

Exa

Exa prefix - Prefix: E

§

Peta

Peta prefix - Prefix P

§

Tera

Tera prefix - Prefix T

§

Giga

Giga prefix - Prefix G

§

Mega

Mega prefix - Prefix M

§

Kilo

Kilo prefix - Prefix k

§

Hecto

hecto prefix - Prefix h

§

Deca

Deca prefix - Prefix da

§

Deci

Deci prefix - Prefix d

§

Centi

Centi prefix - Prefix c

§

Milli

Milli prefix - Prefix m

§

Micro

micro prefix - Prefix m

§

Nano

Nano prefix - Prefix n

§

Pico

Pico prefix - Prefix p

§

Femto

Femto prefix - Prefix f

§

Atto

Atto prefix - Prefix: a

§

Date1

Year-Month-Day

§

Date2

Day / Month / Year

§

Date3

Month / Day / Year

§

Week

Calendar week

§

Time1

UTC Hour / Minute / Second

§

Time2

Hour / Minute / Second

§

DateAndTime1

Second / Minute / Hour / Day / Month / Year

§

DateAndTime2

Second / Minute / Hour / Day / Month / Year / Local minute offset / Local hour offset

§

DateAndTime3

Second / Minute/ Hour / Day / Month / Year

§

DateAndTime4

Second / Minute / Hour / Day / Year / Local minute offset / Local hour offset

Implementations§

source§

impl ScalingByteExtension

source

pub fn get_postfix(&self) -> Option<&'static str>

Returns the optional postfix of the scaling byte

source

pub fn get_prefix(&self) -> Option<&'static str>

Returns the optional prefix of the scaling byte

Trait Implementations§

source§

impl Clone for ScalingByteExtension

source§

fn clone(&self) -> ScalingByteExtension

Returns a copy 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 ScalingByteExtension

source§

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

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

impl From<u8> for ScalingByteExtension

source§

fn from(x: u8) -> Self

Converts to this type from the input type.
source§

impl Ord for ScalingByteExtension

source§

fn cmp(&self, other: &ScalingByteExtension) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ScalingByteExtension> for ScalingByteExtension

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ScalingByteExtension> for ScalingByteExtension

source§

fn partial_cmp(&self, other: &ScalingByteExtension) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for ScalingByteExtension

source§

impl Eq for ScalingByteExtension

source§

impl StructuralEq for ScalingByteExtension

source§

impl StructuralPartialEq for ScalingByteExtension

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.