Struct libdonet::dcnumeric::DCNumericType

source ·
pub struct DCNumericType {
    base_type: DCTypeDefinition,
    divisor: u16,
    orig_modulus: f64,
    orig_range: DCNumericRange,
    modulus: DCNumber,
    range: DCNumericRange,
    explicit_cast: Option<DCTypeDefinition>,
}

Fields§

§base_type: DCTypeDefinition§divisor: u16§orig_modulus: f64§orig_range: DCNumericRange§modulus: DCNumber§range: DCNumericRange§explicit_cast: Option<DCTypeDefinition>

Implementations§

source§

impl DCNumericType

source

pub fn new(base_type: DCTypeEnum) -> Self

source

pub fn generate_hash(&self, hashgen: &mut DCHashGenerator)

Accumulates the properties of this DC element into the file hash.

source

pub fn has_modulus(&self) -> bool

source

pub fn has_range(&self) -> bool

source

pub fn get_divisor(&self) -> u16

source

pub fn get_modulus(&self) -> f64

source

pub fn get_range(&self) -> DCNumericRange

source

pub fn get_explicit_cast(&self) -> Option<DCTypeDefinition>

source

pub fn set_divisor(&mut self, divisor: u16) -> Result<(), String>

source

pub fn set_modulus(&mut self, modulus: f64) -> Result<(), String>

source

pub fn set_range(&mut self, range: DCNumericRange) -> Result<(), String>

source

pub fn set_explicit_cast( &mut self, dtype: DCTypeDefinition, ) -> Result<(), String>

source

pub fn within_range(&self, _data: Vec<u8>, _length: u64) -> Result<(), String>

source

fn data_to_number(&self, data: Vec<u8>) -> (bool, DCNumber)

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