Struct dec::Status

source ·
pub struct Status { /* private fields */ }
Expand description

Represents exceptional conditions resulting from operations on decimal numbers.

For details about the various exceptional conditions, consult the Exceptional Conditions chapter of the General Decimal Arithmetic specification.

Implementations§

source§

impl Status

source

pub fn any(&self) -> bool

Reports whether any of the condition flags are set.

source

pub fn conversion_syntax(&self) -> bool

Reports whether the conversion syntax flag is set.

Operations set this flag when an invalid string is converted to a decimal.

source

pub fn set_conversion_syntax(&mut self)

Sets self’s conversion syntax flag.

source

pub fn division_by_zero(&self) -> bool

Reports whether the division by zero flag is set.

Operations set this flag when a nonzero dividend is divided by zero.

source

pub fn set_division_by_zero(&mut self)

Sets self’s division by zero flag.

source

pub fn division_impossible(&self) -> bool

Reports whether the division impossible flag is set.

Operations set this flag if the integer result of a division had too many digits.

source

pub fn set_division_impossible(&mut self)

Sets self’s division impossible flag.

source

pub fn division_undefined(&self) -> bool

Reports whether the division undefined flag is set.

Operations set this flag when a zero dividend is divided by zero.

source

pub fn set_division_undefined(&mut self)

Sets self’s division undefined flag.

source

pub fn insufficient_storage(&self) -> bool

Reports whether the insufficient storage flag is set.

Operations set this flag if memory allocation fails.

source

pub fn set_insufficient_storage(&mut self)

Sets self’s insufficient storage flag.

source

pub fn inexact(&self) -> bool

Reports whether the inexact flag is set.

Operations set this flag when one or more nonzero coefficient digits were discarded during rounding from a result.

source

pub fn set_inexact(&mut self)

Sets self’s inexact flag.

source

pub fn invalid_context(&self) -> bool

Reports whether the invalid context flag is set.

Operations set this flag if they detect an invalid context.

It should not be possible to pass an invalid context to an operation using this crate, but this method is nonetheless provided for completeness.

source

pub fn set_invalid_context(&mut self)

Sets self’s invalid context flag.

source

pub fn invalid_operation(&self) -> bool

Reports whether the invalid operation flag is set.

Various operations set this flag in response to invalid arguments.

source

pub fn set_invalid_operation(&mut self)

Sets self’s invalid operation flag.

source

pub fn overflow(&self) -> bool

Reports whether the overflow flag is set.

Operations set this flag when the exponent of a result is too large to be represented.

source

pub fn set_overflow(&mut self)

Sets self’s overflow flag.

source

pub fn clamped(&self) -> bool

Reports whether the clamped flag is set.

Operations set this flag when the exponent of a result has been altered or constrained in order to fit the constraints of a specific concrete representation.

source

pub fn set_clamped(&mut self)

Sets self’s clamped flag.

source

pub fn rounded(&self) -> bool

Reports whether the rounded flag is set.

Operations set this flag when one or more zero or nonzero coefficient digits were discarded from a result.

source

pub fn set_rounded(&mut self)

Sets self’s rounded flag.

source

pub fn subnormal(&self) -> bool

Reports whether the subnormal flag is set.

Operations set this flag when a result’s adjusted exponent is less than Emin before any rounding.

source

pub fn set_subnormal(&mut self)

Sets self’s subnormal flag.

source

pub fn underflow(&self) -> bool

Reports whether the underflow flag is set.

Operations set this flag when a result is both subnormal and inexact.

source

pub fn set_underflow(&mut self)

Sets self’s underflow flag.

Trait Implementations§

source§

impl BitAnd for Status

§

type Output = Status

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Status) -> Status

Performs the & operation. Read more
source§

impl BitAndAssign for Status

source§

fn bitand_assign(&mut self, rhs: Status)

Performs the &= operation. Read more
source§

impl BitOr for Status

§

type Output = Status

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Status) -> Status

Performs the | operation. Read more
source§

impl BitOrAssign for Status

source§

fn bitor_assign(&mut self, rhs: Status)

Performs the |= operation. Read more
source§

impl Clone for Status

source§

fn clone(&self) -> Status

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 Status

source§

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

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

impl Default for Status

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hash for Status

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 Status

source§

fn eq(&self, other: &Status) -> 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 Copy for Status

source§

impl Eq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

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> 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,

§

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>,

§

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>,

§

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.