Type Alias ION_DECIMAL

Source
pub type ION_DECIMAL = _ion_decimal;

Aliased Type§

struct ION_DECIMAL {
    pub type_: u32,
    pub value: _ion_decimal__bindgen_ty_1,
}

Fields§

§type_: u32§value: _ion_decimal__bindgen_ty_1

Implementations§

Source§

impl ION_DECIMAL

Source

pub fn try_assign_bigdecimal(&mut self, value: &BigDecimal) -> IonCResult<()>

Assigns a BigDecimal into this ION_DECIMAL.

Source

pub fn try_to_bigdecimal(&mut self) -> IonCResult<BigDecimal>

Converts this ION_DECIMAL to a BigDecimal.

Special decimal values such as NaN and infinity are not supported for conversion.

This implementation borrows mutably, to avoid a copy of the underlying decimal implementation, but does not change the value.

Specifically, this code scales from/to the exponent the value to extract the coefficient.