Skip to main content

DecimalWidth

Enum DecimalWidth 

Source
#[non_exhaustive]
pub enum DecimalWidth {
Show 13 variants D9, D18, D38, D57, D76, D115, D153, D230, D307, D462, D616, D924, D1232,
}
Expand description

Discriminator for the concrete decimal width carried by a DynDecimal value.

Two values are guaranteed to share a concrete Dxx<S> family (i.e. both are some scale of D38, or both some scale of D76, etc.) if and only if their width values compare equal. Use this to dispatch on the storage tier before unpacking.

Variants are gated by the same Cargo features that gate the corresponding decimal width — they are only present in this enum when the underlying Dxx type is enabled in the build.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

D9

32-bit storage; corresponds to crate::D9.

§

D18

64-bit storage; corresponds to crate::D18.

§

D38

128-bit storage; corresponds to crate::D38.

§

D57

192-bit storage; corresponds to crate::D57. Gated by d57 / wide.

§

D76

256-bit storage; corresponds to crate::D76. Gated by d76 / wide.

§

D115

384-bit storage; corresponds to crate::D115. Gated by d115 / wide.

§

D153

512-bit storage; corresponds to crate::D153. Gated by d153 / wide.

§

D230

768-bit storage; corresponds to crate::D230. Gated by d230 / wide.

§

D307

1024-bit storage; corresponds to crate::D307. Gated by d307 / wide / x-wide.

§

D462

1536-bit storage; corresponds to crate::D462. Gated by d462 / x-wide.

§

D616

2048-bit storage; corresponds to crate::D616. Gated by d616 / x-wide.

§

D924

3072-bit storage; corresponds to crate::D924. Gated by d924 / xx-wide.

§

D1232

4096-bit storage; corresponds to crate::D1232. Gated by d1232 / xx-wide.

Trait Implementations§

Source§

impl Clone for DecimalWidth

Source§

fn clone(&self) -> DecimalWidth

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DecimalWidth

Source§

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

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

impl Hash for DecimalWidth

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DecimalWidth

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for DecimalWidth

Source§

impl Eq for DecimalWidth

Source§

impl StructuralPartialEq for DecimalWidth

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.