pub struct DecimalValue { /* private fields */ }Expand description
An exact base-ten decimal represented as coefficient * 10^-scale.
Implementations§
Source§impl DecimalValue
impl DecimalValue
Sourcepub fn new(coefficient: i128, scale: u32) -> Result<Self>
pub fn new(coefficient: i128, scale: u32) -> Result<Self>
Creates a decimal and removes insignificant trailing fractional zeros.
§Errors
Returns ErrorKind::InvalidArgument when the normalized scale
exceeds MAX_METADATA_DECIMAL_SCALE.
Sourcepub const fn coefficient(self) -> i128
pub const fn coefficient(self) -> i128
Returns the signed base-ten coefficient.
Trait Implementations§
Source§impl Clone for DecimalValue
impl Clone for DecimalValue
Source§fn clone(&self) -> DecimalValue
fn clone(&self) -> DecimalValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DecimalValue
Source§impl Debug for DecimalValue
impl Debug for DecimalValue
impl Eq for DecimalValue
Source§impl Hash for DecimalValue
impl Hash for DecimalValue
Source§impl PartialEq for DecimalValue
impl PartialEq for DecimalValue
Source§fn eq(&self, other: &DecimalValue) -> bool
fn eq(&self, other: &DecimalValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecimalValue
Auto Trait Implementations§
impl Freeze for DecimalValue
impl RefUnwindSafe for DecimalValue
impl Send for DecimalValue
impl Sync for DecimalValue
impl Unpin for DecimalValue
impl UnsafeUnpin for DecimalValue
impl UnwindSafe for DecimalValue
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