Enum fixed_decimal::RoundingIncrement
source · #[non_exhaustive]pub enum RoundingIncrement {
MultiplesOf1,
MultiplesOf2,
MultiplesOf5,
MultiplesOf25,
}
Expand description
Increment used in a rounding operation.
Forces a rounding operation to round to only multiples of the specified increment.
🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. Use with caution.
#3929
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.
MultiplesOf1
Round the last digit to any digit (0-9).
This is the default rounding increment for all the methods that don’t take a
RoundingIncrement
as an argument.
MultiplesOf2
Round the last digit to only multiples of two (0, 2, 4, 6, 8).
MultiplesOf5
Round the last digit to only multiples of five (0, 5).
MultiplesOf25
Round the last two digits to only multiples of twenty-five (0, 25, 50, 75).
Trait Implementations§
source§impl Clone for RoundingIncrement
impl Clone for RoundingIncrement
source§fn clone(&self) -> RoundingIncrement
fn clone(&self) -> RoundingIncrement
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RoundingIncrement
impl Debug for RoundingIncrement
source§impl Default for RoundingIncrement
impl Default for RoundingIncrement
source§fn default() -> RoundingIncrement
fn default() -> RoundingIncrement
Returns the “default value” for a type. Read more
source§impl PartialEq for RoundingIncrement
impl PartialEq for RoundingIncrement
source§fn eq(&self, other: &RoundingIncrement) -> bool
fn eq(&self, other: &RoundingIncrement) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for RoundingIncrement
impl Eq for RoundingIncrement
impl StructuralEq for RoundingIncrement
impl StructuralPartialEq for RoundingIncrement
Auto Trait Implementations§
impl RefUnwindSafe for RoundingIncrement
impl Send for RoundingIncrement
impl Sync for RoundingIncrement
impl Unpin for RoundingIncrement
impl UnwindSafe for RoundingIncrement
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