#[repr(u8)]
pub enum ScalingByteExtension {
Show 89 variants NoUnit = 0, Meter = 1, Foot = 2, Inch = 3, Yard = 4, Mile = 5, Gram = 6, Tonne = 7, Second = 8, Minute = 9, Hour = 10, Day = 11, Year = 12, Ampere = 13, Volt = 14, Coulomb = 15, Ohm = 16, Farad = 17, Henry = 18, Siemens = 19, Weber = 20, Tesla = 21, Kelvin = 22, Celsius = 23, Fahrenheit = 24, Candela = 25, Radian = 26, Degree = 27, Hertz = 28, Joule = 29, Newton = 30, Kilopond = 31, PoundForce = 32, Watt = 33, HorsePowerMetric = 34, HorsePowerImperial = 35, Pascal = 36, Bar = 37, Atmosphere = 38, Psi = 39, Becquerel = 40, Lumen = 41, Lux = 42, Liter = 43, GallonImperial = 44, GallonUs = 45, CubicInch = 46, MeterPerSecond = 47, KilometerPerHour = 48, MilePerHour = 49, RevolutionsPerSecond = 50, RevolutionsPerMinute = 51, Counts = 52, Percent = 53, MilligramPerStroke = 54, MeterPerSquareSecond = 55, NewtonMeter = 56, LiterPerMinute = 57, WattPerSquareMeter = 58, BarPerSecond = 59, RadiansPerSecond = 60, RadiansPerSquareSecond = 61, KilogramsPerSquareMeter = 62, Exa = 64, Peta = 65, Tera = 66, Giga = 67, Mega = 68, Kilo = 69, Hecto = 70, Deca = 71, Deci = 72, Centi = 73, Milli = 74, Micro = 75, Nano = 76, Pico = 77, Femto = 78, Atto = 79, Date1 = 80, Date2 = 81, Date3 = 82, Week = 83, Time1 = 84, Time2 = 85, DateAndTime1 = 86, DateAndTime2 = 87, DateAndTime3 = 88, DateAndTime4 = 89,
}
Expand description

! Functions and data for ReadScalingDataById UDS Service FIXME: Use ScalingExtension instead Note: #[deprecated] doesn’t work here due to https://github.com/rust-lang/rust/issues/30827 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 ScalingExtension::get_postfix to return the optional postfix of the scaling byte, or ScalingExtension::get_prefix to return the optional prefix of the scaling byte.

Variants§

§

NoUnit = 0

No unit or presentation

§

Meter = 1

Meter - measure of length. Postfix m

§

Foot = 2

Foot - measure of length. Postfix ft

§

Inch = 3

Inch - measure of length. Postfix in

§

Yard = 4

Yard - measure of length. Postfix yd

§

Mile = 5

English mile - measure of length. Postfix mi

§

Gram = 6

Gram - measure of mass. Postfix g

§

Tonne = 7

Metric tonne - measure of mass. Postfix t

§

Second = 8

Second - measure of time. Postfix s

§

Minute = 9

Minute - measure of time. Postfix min

§

Hour = 10

Hour - measure of time. Postfix h

§

Day = 11

Day - measure of time. Postfix d

§

Year = 12

Year - measure of time. Postfix y

§

Ampere = 13

Ampere - measure of current. Postfix A

§

Volt = 14

Volt - measure of voltage. Postfix V

§

Coulomb = 15

Coulomb - measure of electric charge. Postfix C

§

Ohm = 16

Ohm - measure of resistance. Postfix W

§

Farad = 17

Farad - measure of capacitance. Postfix F

§

Henry = 18

Henry - measure of inductance. Postfix H

§

Siemens = 19

Siemens - measure of electric conductance. Postfix S

§

Weber = 20

Weber - measure of magnetic flux. Postfix Wb

§

Tesla = 21

Tesla - measure of magnetic flux density. Postfix T

§

Kelvin = 22

Kelvin - measure of thermodynamic temperature. Postfix K

§

Celsius = 23

Celsius - measure of thermodynamic temperature. Postfix °C

§

Fahrenheit = 24

Fahrenheit - measure of thermodynamic temperature. Postfix °F

§

Candela = 25

Candela - measure of luminous intensity. Postfix cd

§

Radian = 26

Radians - measure of plane angle. Postfix rad

§

Degree = 27

Degrees - measure of plane angle. Postfix °

§

Hertz = 28

Hertz - measure of frequency. Postfix Hz

§

Joule = 29

Joule - measure of energy. Postfix J

§

Newton = 30

Newton - measure of force. Postfix N

§

Kilopond = 31

Kilopond - measure of force. Postfix kp

§

PoundForce = 32

Pound force - measure of force. Postfix lbf

§

Watt = 33

Watt - measure of power. Postfix W

§

HorsePowerMetric = 34

Metric horse power - measure of power. Postfix hk

§

HorsePowerImperial = 35

Imperial horse power - measure of power. Postfix hp

§

Pascal = 36

Pascal - measure of pressure. Postfix Pa

§

Bar = 37

Bar - measure of pressure. Postfix bar

§

Atmosphere = 38

Atmosphere - measure of pressure. Postfix atm

§

Psi = 39

Pound force per square inch - measure of pressure. Postfix psi

§

Becquerel = 40

Becquerel - measure of radioactivity. Postfix Bq

§

Lumen = 41

Lumen - measure of light flux. Postfix lm

§

Lux = 42

Lux - measure of illuminance. Postfix lx

§

Liter = 43

Liter - measure of volume. Postfix l

§

GallonImperial = 44

British gallon - measure of volume.

§

GallonUs = 45

US liquid gallon - measure of volume.

§

CubicInch = 46

Cubic inch - measure of volume. Postfix cu in

§

MeterPerSecond = 47

Meter per second - measure of speed. Postfix m/s

§

KilometerPerHour = 48

Kilometers per hour - measure of speed. Postfix km/h

§

MilePerHour = 49

Miles per hour - measure of speed. Postfix mph

§

RevolutionsPerSecond = 50

Revolutions per second - measure of angular velocity. Postfix rps

§

RevolutionsPerMinute = 51

Revolutions per minute - measure of angular velocity. Postfix rpm

§

Counts = 52

Count.

§

Percent = 53

Percent. Postfix %

§

MilligramPerStroke = 54

Milligram per stroke - measure of mass per engine stroke. Postfix mg/stroke

§

MeterPerSquareSecond = 55

Meter per square second - measure of acceleration. Postfix m/s²

§

NewtonMeter = 56

Newton meter - measure of moment (e.g. torsion moment). Postfix Nm

§

LiterPerMinute = 57

Liter per minute - measure of flow. Postfix l/min

§

WattPerSquareMeter = 58

Watt per square meter W/m2 Intensity - measure of Intensity. Postfix W/m²

§

BarPerSecond = 59

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

§

RadiansPerSecond = 60

Radians per second - measure of angular velocity. Postfix rad/s

§

RadiansPerSquareSecond = 61

Radians per square second - measure of angular acceleration. Postfix rad/s²

§

KilogramsPerSquareMeter = 62

Kilograms per square meter. Postfix kg/m²

§

Exa = 64

Exa 10^18 Prefix E

§

Peta = 65

Peta 10^15 Prefix P

§

Tera = 66

Tera 10^12 Prefix T

§

Giga = 67

Giga 10^9 Prefix G

§

Mega = 68

Mega 10^6 Prefix M

§

Kilo = 69

Kilo 10^3 Prefix k

§

Hecto = 70

Hecto 10^2 Prefix h

§

Deca = 71

Deca 10^1 Prefix da

§

Deci = 72

Deci 10^-1 Prefix d

§

Centi = 73

Centi 10^-2 Prefix c

§

Milli = 74

Milli 10^-3 Prefix m

§

Micro = 75

Micro 10^-6 Prefix m

§

Nano = 76

Nano 10^-9 Prefix n

§

Pico = 77

Pico 10^-12 Prefix p

§

Femto = 78

Femto 10^-15 Prefix f

§

Atto = 79

Atto 10^-18 Prefix a

§

Date1 = 80

Date in Year-Month-Day format.

§

Date2 = 81

Date in Day/Month/Year format.

§

Date3 = 82

Date in Month/Day/Year format.

§

Week = 83

Calendar week. Postfix W

§

Time1 = 84

Time in UTC Hour/Minute/Second format.

§

Time2 = 85

Time in Hour/Minute/Second format.

§

DateAndTime1 = 86

Date and time1 in Second/Minute/Hour/Day/Month/Year format.

§

DateAndTime2 = 87

DateAndTime2 in Second/Minute/Hour/Day/Month/Year/Local minute offset/Local hour offset format.

§

DateAndTime3 = 88

DateAndTime3 in Second/Minute/Hour/Month/Day/Year format.

§

DateAndTime4 = 89

DateAndTime4 in Second/Minute/Hour/Month/Day/Year/Local minute offset/Local hour offset format.

Implementations§

source§

impl ScalingExtension

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 ScalingExtension

source§

fn clone(&self) -> ScalingExtension

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 ScalingExtension

source§

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

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

impl From<ScalingExtension> for ByteWrapper<ScalingExtension>

source§

fn from(value: ScalingExtension) -> ByteWrapper<ScalingExtension>

Converts to this type from the input type.
source§

impl Ord for ScalingExtension

source§

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

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

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

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

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

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

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

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

impl PartialEq for ScalingExtension

source§

fn eq(&self, other: &ScalingExtension) -> 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 for ScalingExtension

source§

fn partial_cmp(&self, other: &ScalingExtension) -> 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 TryFrom<u8> for ScalingExtension

§

type Error = &'static str

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

fn try_from( value: u8 ) -> Result<ScalingExtension, <ScalingExtension as TryFrom<u8>>::Error>

Performs the conversion.
source§

impl Copy for ScalingExtension

source§

impl Eq for ScalingExtension

source§

impl StructuralPartialEq for ScalingExtension

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> 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,

§

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>,

§

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>,

§

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.