[][src]Struct line_drawing::steps::Steps

pub struct Steps<T, I> { /* fields omitted */ }

An iterator that returns (start, end) tuples from the walk.

All the algorithms in this crate should have a steps() function associated with them to turn them into a Steps iterator.

Example using WalkGrid:

extern crate line_drawing;
use line_drawing::WalkGrid;

fn main() {
    for (start, end) in WalkGrid::new((0, 0), (5, 3)).steps() {
        println!("{:?} -> {:?}", start, end);
    }
}
(0, 0) -> (1, 0)
(1, 0) -> (1, 1)
(1, 1) -> (2, 1)
(2, 1) -> (2, 2)
(2, 2) -> (3, 2)
(3, 2) -> (4, 2)
(4, 2) -> (4, 3)
(4, 3) -> (5, 3)

Methods

impl<T: Copy, I: Iterator<Item = T>> Steps<T, I>[src]

pub fn new(iterator: I) -> Self[src]

Trait Implementations

impl<T: Copy, I: Iterator<Item = T>> Iterator for Steps<T, I>[src]

type Item = (T, T)

The type of the elements being iterated over.

Auto Trait Implementations

impl<T, I> Send for Steps<T, I> where
    I: Send,
    T: Send

impl<T, I> Unpin for Steps<T, I> where
    I: Unpin,
    T: Unpin

impl<T, I> Sync for Steps<T, I> where
    I: Sync,
    T: Sync

impl<T, I> UnwindSafe for Steps<T, I> where
    I: UnwindSafe,
    T: UnwindSafe

impl<T, I> RefUnwindSafe for Steps<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]