#[repr(u8)]pub enum OverflowMode {
Wrap = 0,
Panic = 1,
Saturate = 2,
}Expand description
Variants§
Wrap = 0
Specifies that arithmetic operations should wrap around on overflow.
Panic = 1
Specifies that arithmetic operations should panic on overflow.
Saturate = 2
Specifies that arithmetic operations should saturate to the integer type’s maximum or minimum value on overflow.
Implementations§
Source§impl OverflowMode
impl OverflowMode
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The default overflow mode, which is the mode used for Integer types when the const-generic parameter OM is not explicitly specified.
The value of DEFAULT is controlled by the overflow-checks flag: if overflow checks are enabled, then DEFAULT is Self::Panic; if overflow checks are disabled, then DEFAULT is Self::Wrap.
Trait Implementations§
Source§impl Clone for OverflowMode
impl Clone for OverflowMode
Source§fn clone(&self) -> OverflowMode
fn clone(&self) -> OverflowMode
Returns a duplicate 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 OverflowMode
impl Debug for OverflowMode
Source§impl Hash for OverflowMode
impl Hash for OverflowMode
Source§impl PartialEq for OverflowMode
impl PartialEq for OverflowMode
impl Copy for OverflowMode
impl Eq for OverflowMode
impl StructuralPartialEq for OverflowMode
Auto Trait Implementations§
impl Freeze for OverflowMode
impl RefUnwindSafe for OverflowMode
impl Send for OverflowMode
impl Sync for OverflowMode
impl Unpin for OverflowMode
impl UnsafeUnpin for OverflowMode
impl UnwindSafe for OverflowMode
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