pub struct Decimal128 { /* private fields */ }
Expand description
Represents a decimal value with precision and scale. The decimal value could represented by a signed 128-bit integer.
Implementations
sourceimpl Decimal128
impl Decimal128
Trait Implementations
sourceimpl BasicDecimal for Decimal128
impl BasicDecimal for Decimal128
sourcefn new(precision: usize, scale: usize, bytes: &[u8]) -> Self
fn new(precision: usize, scale: usize, bytes: &[u8]) -> Self
Creates a decimal value from precision, scale, and bytes. Read more
sourcefn raw_value(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn raw_value(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Returns the raw bytes of the integer representation of the decimal.
sourcefn try_new_from_bytes(
precision: usize,
scale: usize,
bytes: &[u8]
) -> Result<Self> where
Self: Sized,
fn try_new_from_bytes(
precision: usize,
scale: usize,
bytes: &[u8]
) -> Result<Self> where
Self: Sized,
Tries to create a decimal value from precision, scale and bytes. If the length of bytes isn’t same as the bit width of this decimal, returning an error. The bytes should be stored in little-endian order. Read more
sourceimpl Debug for Decimal128
impl Debug for Decimal128
sourceimpl From<Decimal128> for i128
impl From<Decimal128> for i128
sourcefn from(decimal: Decimal128) -> Self
fn from(decimal: Decimal128) -> Self
Converts to this type from the input type.
sourceimpl Ord for Decimal128
impl Ord for Decimal128
sourceimpl PartialEq<Decimal128> for Decimal128
impl PartialEq<Decimal128> for Decimal128
sourceimpl PartialOrd<Decimal128> for Decimal128
impl PartialOrd<Decimal128> for Decimal128
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Decimal128
Auto Trait Implementations
impl RefUnwindSafe for Decimal128
impl Send for Decimal128
impl Sync for Decimal128
impl Unpin for Decimal128
impl UnwindSafe for Decimal128
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.