Enum binary_data_schema::NumberSchema[][src]

pub enum NumberSchema {
    Integer {
        integer: IntegerSchema,
        scale: f64,
        offset: f64,
    },
    Float {
        byteorder: ByteOrder,
    },
    Double {
        byteorder: ByteOrder,
    },
}

The number schema describes a numeric value.

Variants

Integer

Fields of Integer

integer: IntegerSchemascale: f64offset: f64
Float

Fields of Float

byteorder: ByteOrder
Double

Fields of Double

byteorder: ByteOrder

Implementations

impl NumberSchema[src]

pub fn default_length() -> usize[src]

Default length is 8 bytes like a double-precision floating-point number.

pub fn default_scale() -> f64[src]

Default scale is neutral, i.e. 1.0.

pub fn default_offset() -> f64[src]

Default offset is neutral, i.e. 0.0.

pub fn new_integer(integer: IntegerSchema, scale: f64, offset: f64) -> Self[src]

pub fn new_raw(length: usize, byteorder: ByteOrder) -> Result<Self>[src]

pub fn to_binary_value(&self, value: f64) -> i64[src]

Apply scale and offset to the value.

pub fn from_binary_value(&self, value: f64) -> f64[src]

Apply scale and offset to the value.

pub fn length(&self) -> usize[src]

Trait Implementations

impl Clone for NumberSchema[src]

impl Debug for NumberSchema[src]

impl Decoder for NumberSchema[src]

impl<'de> Deserialize<'de> for NumberSchema[src]

impl Encoder for NumberSchema[src]

impl From<NumberSchema> for DataSchema[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.