[][src]Struct griditer::PerimeterIter

pub struct PerimeterIter<C> { /* fields omitted */ }

Iterator that yields points at the perimeter of a rect on a grid, clockwise.

Implementations

impl<C> PerimeterIter<C> where
    C: Coord
[src]

pub fn with_dimensions((left, top): (C, C), (width, height): (C, C)) -> Self[src]

Constructs PerimeterIter that will yield points on the perimeter of the grid rect given by top-left corner coordinates and dimensions.

left and top refer to the minimal rect coordinates along corresponding axes.

The points are yielded without repetitions.
If either of the dimensions is 0 the iterator won't yield any points.
If width or height is 1, points along a single grid column or row respecively will be yielded.
If both dimensions are 1, only (left, top) will be yielded.

pub fn with_corners((left, top): (C, C), (right, bottom): (C, C)) -> Self[src]

Constructs PerimeterIter that will yield points on the perimeter of the grid rect given by top-left and bottom-right corner coordinates and dimensions.

left and top must not be greater than right and bottom respectively.

The points are yielded without repetitions.
If both corners have a common coordinate, only points along a single grid column or row will be yielded.
If both corners are equal, only (left, top) will be yielded.

Trait Implementations

impl<C: Clone> Clone for PerimeterIter<C>[src]

impl<C: Debug> Debug for PerimeterIter<C>[src]

impl<C> Iterator for PerimeterIter<C> where
    C: Coord
[src]

type Item = (C, C)

The type of the elements being iterated over.

Auto Trait Implementations

impl<C> RefUnwindSafe for PerimeterIter<C> where
    C: RefUnwindSafe

impl<C> Send for PerimeterIter<C> where
    C: Send

impl<C> Sync for PerimeterIter<C> where
    C: Sync

impl<C> Unpin for PerimeterIter<C> where
    C: Unpin

impl<C> UnwindSafe for PerimeterIter<C> where
    C: UnwindSafe

Blanket Implementations

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

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

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

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.