Enum ion_rs::types::Mantissa

source ·
pub enum Mantissa {
    Digits(u32),
    Arbitrary(Decimal),
}
Expand description

Stores the precision of a Timestamp’s fractional seconds, if present. This type is not self-contained; if the Timestamp has a precision that is less than or equal to nanoseconds (i.e. fewer than 10 digits), the fractional seconds value will be stored in the Timestamp’s NaiveDateTime component and the Mantissa will indicate the number of digits from that value that should be used. If the precision is 10 or more digits, the Mantissa will store the value itself as a Decimal with the correct precision.

Variants§

§

Digits(u32)

The number of digits of precision in the Timestamp’s fractional seconds. For example, a value of 3 would indicate millisecond precision. A value of 6 would indicate microsecond precision. All precisions less than or equal to nanoseconds should use this representation when possible.

§

Arbitrary(Decimal)

Specifies the fractional seconds precisely as a Decimal in the range >= 0 and < 1. The Decimal will have the correct precision; the complete value can and should be used. This representation should only be used for precisions greater than nanoseconds as can require allocations.

Trait Implementations§

source§

impl Clone for Mantissa

source§

fn clone(&self) -> Mantissa

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mantissa

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Mantissa> for Mantissa

source§

fn eq(&self, other: &Mantissa) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Mantissa

source§

impl StructuralEq for Mantissa

source§

impl StructuralPartialEq for Mantissa

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.