Trait step::Step [] [src]

pub trait Step: Sized {
    fn next(&self) -> Option<Self>;
    fn next_by(&self, by: &Self) -> Option<Self>;
    fn prev(&self) -> Option<Self>;
    fn prev_by(&self, by: &Self) -> Option<Self>;
    fn steps_to(&self, value: &Self) -> Self;
}

Types that can be incremented or decremented by a unit value or a given value.

Required Methods

Return the next sequential value for the type

Return the value a given amount after the value

Return the previous sequential value for the type

Return the value a given amount before the value

Return the steps to another value

The return value will be the number of steps between the two values (i.e. it will always be a positive number).

Implementors