Trait core::iter::Step
[−]
[src]
pub trait Step: PartialOrd { fn step(&self, by: &Self) -> Option<Self>; fn steps_between(start: &Self, end: &Self, by: &Self) -> Option<usize>; }
: likely to be replaced by finer-grained traits
Objects that can be stepped over in both directions.
The steps_between
`steps_betweenfunction provides a way to efficiently compare two
` function provides a way to efficiently compare
two Step
`Step` objects.
Required Methods
fn step(&self, by: &Self) -> Option<Self>
: likely to be replaced by finer-grained traits
Steps self
`self` if possible.
fn steps_between(start: &Self, end: &Self, by: &Self) -> Option<usize>
: likely to be replaced by finer-grained traits
Returns the number of steps between two step objects. The count is
inclusive of start
`startand exclusive of
` and exclusive of end
`end`.
Returns None
`Noneif it is not possible to calculate
` if it is not possible to calculate steps_between
`steps_between`
without overflow.