Step

Trait Step 

Source
pub trait Step:
    ConstOne
    + ConstZero
    + Copy
    + PartialOrd
    + Ord
    + Mul<Output = Self>
    + MulAssign<Self>
    + CheckedMul
    + Debug
    + ToPrimitive
    + Display
    + SaturatingAdd
    + SaturatingSub
    + 'static {
    // Provided methods
    fn next(self) -> Self { ... }
    fn prev(self) -> Self { ... }
}
Expand description

Types that support stepping forward and backward with saturating arithmetic.

Provided Methods§

Source

fn next(self) -> Self

Returns the next value.

§Examples
use multi_ranged::Step;
assert_eq!(1.next(), 2);
Source

fn prev(self) -> Self

Returns the previous value.

§Examples
use multi_ranged::Step;
assert_eq!(2.prev(), 1);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Step for T
where T: ConstOne + ConstZero + Copy + PartialOrd + Ord + Mul<Output = Self> + MulAssign<Self> + CheckedMul + Debug + ToPrimitive + Display + SaturatingAdd + SaturatingSub + 'static,