pub enum NumberSchema {
Integer {
integer: IntegerSchema,
scale: f64,
offset: f64,
},
Float {
byteorder: ByteOrder,
},
Double {
byteorder: ByteOrder,
},
}
Expand description
The number schema describes a numeric value (further information on the module’s documentation).
Variants§
Implementations§
Source§impl NumberSchema
impl NumberSchema
Sourcepub fn default_length() -> usize
pub fn default_length() -> usize
Default length is 8 bytes like a double-precision floating-point number.
Sourcepub fn default_scale() -> f64
pub fn default_scale() -> f64
Default scale is neutral, i.e. 1.0
.
Sourcepub fn default_offset() -> f64
pub fn default_offset() -> f64
Default offset is neutral, i.e. 0.0
.
Sourcepub fn to_binary_value(&self, value: f64) -> i64
pub fn to_binary_value(&self, value: f64) -> i64
Apply scale and offset to the value.
Sourcepub fn from_binary_value(&self, value: f64) -> f64
pub fn from_binary_value(&self, value: f64) -> f64
Apply scale and offset to the value.
pub fn length(&self) -> usize
Trait Implementations§
Source§impl Clone for NumberSchema
impl Clone for NumberSchema
Source§fn clone(&self) -> NumberSchema
fn clone(&self) -> NumberSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NumberSchema
impl Debug for NumberSchema
Source§impl Decoder for NumberSchema
impl Decoder for NumberSchema
Source§impl<'de> Deserialize<'de> for NumberSchema
impl<'de> Deserialize<'de> for NumberSchema
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encoder for NumberSchema
impl Encoder for NumberSchema
Source§impl From<NumberSchema> for InnerSchema
impl From<NumberSchema> for InnerSchema
Source§fn from(v: NumberSchema) -> Self
fn from(v: NumberSchema) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NumberSchema
impl RefUnwindSafe for NumberSchema
impl Send for NumberSchema
impl Sync for NumberSchema
impl Unpin for NumberSchema
impl UnwindSafe for NumberSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more