Skip to main content

PolygonSlices

Struct PolygonSlices 

Source
pub struct PolygonSlices<'s, V, R> { /* private fields */ }
Expand description

Lazy iterator over the slices of a polygon in every tile it reaches; see Slicer::polygon.

A lending iterator: a PolygonPiece borrows the iterator’s piece buffer, so it is valid until the next call to next. Loop with while let Some(slice) = slices.next().

Implementations§

Source§

impl<'s, V: PolyVertex, R: AsRef<[V]>> PolygonSlices<'s, V, R>

Source

pub fn next(&mut self) -> Option<Result<PolygonSlice<'_, V, R>, TileError>>

The next slice, or None when the polygon is done. An error ends the iteration: only TileError::GeometryTooLarge, for a piece of more than u32::MAX vertices, since Slicer::polygon settled every overflow up front.

Source

pub fn fill_ring(&self, run: &FillRun) -> [V; 5]

The ring Slicer::tile_polygon yields for run’s polygon in each tile of the run: the tile’s buffered box grown by one unit, tile-local and closed (its first vertex repeated), all synthetic vertices, wound like the polygon’s exterior. It is the polygon’s only ring there. The same as Slicer::fill_ring, for use while the iterator borrows the slicer.

Auto Trait Implementations§

§

impl<'s, V, R> !UnwindSafe for PolygonSlices<'s, V, R>

§

impl<'s, V, R> Freeze for PolygonSlices<'s, V, R>
where &'s [R]: Freeze, &'s mut PolyScratch<V>: Freeze,

§

impl<'s, V, R> RefUnwindSafe for PolygonSlices<'s, V, R>
where &'s [R]: RefUnwindSafe, &'s mut PolyScratch<V>: RefUnwindSafe,

§

impl<'s, V, R> Send for PolygonSlices<'s, V, R>
where &'s [R]: Send, &'s mut PolyScratch<V>: Send,

§

impl<'s, V, R> Sync for PolygonSlices<'s, V, R>
where &'s [R]: Sync, &'s mut PolyScratch<V>: Sync,

§

impl<'s, V, R> Unpin for PolygonSlices<'s, V, R>
where &'s [R]: Unpin, &'s mut PolyScratch<V>: Unpin,

§

impl<'s, V, R> UnsafeUnpin for PolygonSlices<'s, V, R>
where &'s [R]: UnsafeUnpin, &'s mut PolyScratch<V>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.