pub struct IntermediateDecimal { /* private fields */ }
Expand description
An intermediate placeholder for a decimal
Implementations§
source§impl IntermediateDecimal
impl IntermediateDecimal
sourcepub fn value(&self) -> BigDecimal
pub fn value(&self) -> BigDecimal
Get the integer part of the fixed-point representation of this intermediate decimal.
sourcepub fn precision(&self) -> u8
pub fn precision(&self) -> u8
Get the precision of the fixed-point representation of this intermediate decimal.
sourcepub fn scale(&self) -> i8
pub fn scale(&self) -> i8
Get the scale of the fixed-point representation of this intermediate decimal.
sourcepub fn try_into_bigint_with_precision_and_scale(
&self,
precision: u8,
scale: i8,
) -> Result<BigInt, IntermediateDecimalError>
pub fn try_into_bigint_with_precision_and_scale( &self, precision: u8, scale: i8, ) -> Result<BigInt, IntermediateDecimalError>
Attempts to convert the decimal to BigInt
while adjusting it to the specified precision and scale.
Returns an error if the conversion cannot be performed due to precision or scale constraints.
Trait Implementations§
source§impl Clone for IntermediateDecimal
impl Clone for IntermediateDecimal
source§fn clone(&self) -> IntermediateDecimal
fn clone(&self) -> IntermediateDecimal
Returns a copy 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 IntermediateDecimal
impl Debug for IntermediateDecimal
source§impl<'de> Deserialize<'de> for IntermediateDecimal
impl<'de> Deserialize<'de> for IntermediateDecimal
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for IntermediateDecimal
impl Display for IntermediateDecimal
source§impl From<IntermediateDecimal> for Literal
impl From<IntermediateDecimal> for Literal
source§fn from(val: IntermediateDecimal) -> Self
fn from(val: IntermediateDecimal) -> Self
Converts to this type from the input type.
source§impl From<i128> for IntermediateDecimal
impl From<i128> for IntermediateDecimal
source§impl From<i64> for IntermediateDecimal
impl From<i64> for IntermediateDecimal
source§impl FromStr for IntermediateDecimal
impl FromStr for IntermediateDecimal
source§impl PartialEq for IntermediateDecimal
impl PartialEq for IntermediateDecimal
source§fn eq(&self, other: &IntermediateDecimal) -> bool
fn eq(&self, other: &IntermediateDecimal) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for IntermediateDecimal
impl Serialize for IntermediateDecimal
source§impl TryFrom<&str> for IntermediateDecimal
impl TryFrom<&str> for IntermediateDecimal
source§impl TryFrom<IntermediateDecimal> for i128
impl TryFrom<IntermediateDecimal> for i128
§type Error = IntermediateDecimalError
type Error = IntermediateDecimalError
The type returned in the event of a conversion error.
source§impl TryFrom<IntermediateDecimal> for i64
impl TryFrom<IntermediateDecimal> for i64
§type Error = IntermediateDecimalError
type Error = IntermediateDecimalError
The type returned in the event of a conversion error.
source§impl TryFrom<String> for IntermediateDecimal
impl TryFrom<String> for IntermediateDecimal
impl Eq for IntermediateDecimal
impl StructuralPartialEq for IntermediateDecimal
Auto Trait Implementations§
impl Freeze for IntermediateDecimal
impl RefUnwindSafe for IntermediateDecimal
impl Send for IntermediateDecimal
impl Sync for IntermediateDecimal
impl Unpin for IntermediateDecimal
impl UnwindSafe for IntermediateDecimal
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)