pub enum DecimalValue {
I8(i8),
I16(i16),
I32(i32),
I64(i64),
I128(i128),
I256(i256),
}
Expand description
A decimal value that can be stored in various integer widths.
This enum represents decimal values with different storage sizes, from 8-bit to 256-bit integers.
Variants§
I8(i8)
8-bit signed decimal value.
I16(i16)
16-bit signed decimal value.
I32(i32)
32-bit signed decimal value.
I64(i64)
64-bit signed decimal value.
I128(i128)
128-bit signed decimal value.
I256(i256)
256-bit signed decimal value.
Implementations§
Source§impl DecimalValue
impl DecimalValue
Sourcepub fn cast<T: NativeDecimalType>(&self) -> Option<T>
pub fn cast<T: NativeDecimalType>(&self) -> Option<T>
Cast self
to T using the respective ToPrimitive
method.
If the value cannot be represented by T
, None
is returned.
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 · 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 DecimalValue
impl Debug for DecimalValue
Source§impl Display for DecimalValue
impl Display for DecimalValue
Source§impl From<DecimalValue> for Scalar
impl From<DecimalValue> for Scalar
Source§fn from(value: DecimalValue) -> Self
fn from(value: DecimalValue) -> Self
Converts to this type from the input type.
Source§impl From<DecimalValue> for ScalarValue
impl From<DecimalValue> for ScalarValue
Source§fn from(value: DecimalValue) -> Self
fn from(value: DecimalValue) -> Self
Converts to this type from the input type.
Source§impl From<i128> for DecimalValue
impl From<i128> for DecimalValue
Source§impl From<i16> for DecimalValue
impl From<i16> for DecimalValue
Source§impl From<i256> for DecimalValue
impl From<i256> for DecimalValue
Source§impl From<i32> for DecimalValue
impl From<i32> for DecimalValue
Source§impl From<i64> for DecimalValue
impl From<i64> for DecimalValue
Source§impl From<i8> for DecimalValue
impl From<i8> for DecimalValue
Source§impl From<u16> for DecimalValue
impl From<u16> for DecimalValue
Source§impl From<u32> for DecimalValue
impl From<u32> for DecimalValue
Source§impl From<u64> for DecimalValue
impl From<u64> for DecimalValue
Source§impl From<u8> for DecimalValue
impl From<u8> for DecimalValue
Source§impl Hash for DecimalValue
impl Hash for DecimalValue
Source§impl PartialEq for DecimalValue
impl PartialEq for DecimalValue
Source§impl PartialOrd for DecimalValue
impl PartialOrd for DecimalValue
Source§impl TryFrom<&Scalar> for DecimalValue
impl TryFrom<&Scalar> for DecimalValue
Source§impl TryFrom<Scalar> for DecimalValue
impl TryFrom<Scalar> for DecimalValue
impl Copy for DecimalValue
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more