pub trait SerialPrimitive: Copy + Ord {
const HALF: Self;
// Required methods
fn wrapping_add(self, rhs: Self) -> Self;
fn wrapping_sub(self, rhs: Self) -> Self;
}Expand description
An unsigned integer type that can serve as the underlying storage for a serial number.
Already implemented for u8/u16/u32/u64/u128/usize; usually no manual implementation
is needed.
Required Associated Constants§
Required Methods§
Sourcefn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
Wraparound addition.
Sourcefn wrapping_sub(self, rhs: Self) -> Self
fn wrapping_sub(self, rhs: Self) -> Self
Wraparound subtraction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".