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.
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 IncrementLike for RoundingIncrement
impl IncrementLike for RoundingIncrement
const MULTIPLES_OF_1: Option<Self> = _
const MULTIPLES_OF_2: Option<Self> = _
const MULTIPLES_OF_5: Option<Self> = _
const MULTIPLES_OF_25: Option<Self> = _
source§impl PartialEq for RoundingIncrement
impl PartialEq for RoundingIncrement
impl Copy for RoundingIncrement
impl Eq for RoundingIncrement
impl StructuralPartialEq for RoundingIncrement
Auto Trait Implementations§
impl Freeze for RoundingIncrement
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)