#[non_exhaustive]pub enum Rounding {
NearestAway,
Floor,
Ceil,
TowardZero,
}Expand description
How a rescale operation rounds a result that falls between two integer ticks of the target base.
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.
NearestAway
Round to the nearest tick; a tie (exactly halfway) rounds away
from zero (+1.5 → +2, -1.5 → -2). The default, and the mode
the plain rescale uses.
Floor
Round toward negative infinity. The right choice for DTS-like stamps that must never land after the true instant.
Ceil
Round toward positive infinity. The mirror of Rounding::Floor
for end-of-range stamps that must never land before the true
instant.
TowardZero
Round toward zero (truncate the fractional part).
Trait Implementations§
impl Copy for Rounding
impl Eq for Rounding
impl StructuralPartialEq for Rounding
Auto Trait Implementations§
impl Freeze for Rounding
impl RefUnwindSafe for Rounding
impl Send for Rounding
impl Sync for Rounding
impl Unpin for Rounding
impl UnsafeUnpin for Rounding
impl UnwindSafe for Rounding
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