Step

Trait Step 

Source
pub trait Step: Sized {
    // Required methods
    fn forward(start: Self, count: usize) -> Option<Self>;
    fn backward(start: Self, count: usize) -> Option<Self>;
}
Expand description

A type which successor and predecessor operations can be performed on.

Similar to std::iter::Step, but not nightly-only.

Required Methods§

Source

fn forward(start: Self, count: usize) -> Option<Self>

Steps forwards by count elements.

Source

fn backward(start: Self, count: usize) -> Option<Self>

Steps backwards by count elements.

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.

Implementations on Foreign Types§

Source§

impl Step for i8

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for i16

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for i32

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for i64

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for i128

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for isize

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for u8

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for u16

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for u32

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for u64

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for u128

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Source§

impl Step for usize

Source§

fn forward(start: Self, count: usize) -> Option<Self>

Source§

fn backward(start: Self, count: usize) -> Option<Self>

Implementors§