Struct donet_core::dcnumeric::DCNumericType
source · pub struct DCNumericType {
base_type: DCTypeDefinition,
divisor: u16,
orig_modulus: f64,
orig_range: Option<DCNumericRange>,
modulus: f64,
range: Option<DCNumericRange>,
explicit_cast: Option<DCTypeDefinition>,
}
Fields§
§base_type: DCTypeDefinition
§divisor: u16
§orig_modulus: f64
These are the original range and modulus values from the file, unscaled by the divisor.
orig_range: Option<DCNumericRange>
§modulus: f64
These are the range and modulus values after scaling by the divisor.
range: Option<DCNumericRange>
§explicit_cast: Option<DCTypeDefinition>
Specific to Donet’s DC language
Implementations§
source§impl DCNumericType
impl DCNumericType
pub fn has_modulus(&self) -> bool
pub fn has_range(&self) -> bool
pub fn get_divisor(&self) -> u16
pub fn get_modulus(&self) -> f64
pub fn get_range(&self) -> Option<DCNumericRange>
pub fn get_explicit_cast(&self) -> Option<DCTypeDefinition>
pub fn set_divisor(&mut self, divisor: u16) -> Result<(), String>
pub fn set_modulus(&mut self, modulus: f64) -> Result<(), String>
pub fn set_range(&mut self, range: DCNumericRange) -> Result<(), String>
pub fn set_explicit_cast( &mut self, dtype: DCTypeDefinition, ) -> Result<(), String>
pub fn within_range(&self, _data: Vec<u8>, _length: u64) -> Result<(), String>
fn _data_to_number(&self, data: Vec<u8>) -> (bool, DCNumber)
Trait Implementations§
source§impl From<DCTypeEnum> for DCNumericType
impl From<DCTypeEnum> for DCNumericType
source§fn from(value: DCTypeEnum) -> Self
fn from(value: DCTypeEnum) -> Self
Converts to this type from the input type.
source§impl LegacyDCHash for DCNumericType
impl LegacyDCHash for DCNumericType
source§fn generate_hash(&self, hashgen: &mut DCHashGenerator)
fn generate_hash(&self, hashgen: &mut DCHashGenerator)
Accumulates the properties of this DC element into the file hash.
Auto Trait Implementations§
impl Freeze for DCNumericType
impl RefUnwindSafe for DCNumericType
impl Send for DCNumericType
impl Sync for DCNumericType
impl Unpin for DCNumericType
impl UnwindSafe for DCNumericType
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