#[non_exhaustive]pub enum RoundingStrategy {
MidpointNearestEven,
MidpointAwayFromZero,
MidpointTowardZero,
ToZero,
AwayFromZero,
ToNegativeInfinity,
ToPositiveInfinity,
}Expand description
Rounding strategy supported by decimal operations.
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.
MidpointNearestEven
Round halves toward the nearest even digit.
MidpointAwayFromZero
Round halves away from zero.
MidpointTowardZero
Round halves toward zero.
ToZero
Always round toward zero.
AwayFromZero
Always round away from zero.
ToNegativeInfinity
Always round toward negative infinity.
ToPositiveInfinity
Always round toward positive infinity.
Trait Implementations§
Source§impl Clone for RoundingStrategy
impl Clone for RoundingStrategy
Source§fn clone(&self) -> RoundingStrategy
fn clone(&self) -> RoundingStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RoundingStrategy
Source§impl Debug for RoundingStrategy
impl Debug for RoundingStrategy
impl Eq for RoundingStrategy
Source§impl From<RoundingStrategy> for RoundingStrategy
Available on non-crate feature bigdecimal only.
impl From<RoundingStrategy> for RoundingStrategy
Available on non-crate feature
bigdecimal only.Source§fn from(value: RoundingStrategy) -> Self
fn from(value: RoundingStrategy) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RoundingStrategy
impl PartialEq for RoundingStrategy
Source§fn eq(&self, other: &RoundingStrategy) -> bool
fn eq(&self, other: &RoundingStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RoundingStrategy
Auto Trait Implementations§
impl Freeze for RoundingStrategy
impl RefUnwindSafe for RoundingStrategy
impl Send for RoundingStrategy
impl Sync for RoundingStrategy
impl Unpin for RoundingStrategy
impl UnsafeUnpin for RoundingStrategy
impl UnwindSafe for RoundingStrategy
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