Struct lyon_path::polygon::Polygon[][src]

pub struct Polygon<'l, T> {
    pub points: &'l [T],
    pub closed: bool,
}
Expand description

A view over a sequence of endpoints forming a polygon.

Example

use lyon_path::polygon::Polygon;
use lyon_path::geom::point;

let path = Polygon {
    points: &[
        point(0.0, 0.0),
        point(10.0, 10.0),
        point(0.0, 10.0),
    ],
    closed: true,
};

for event in path.path_events() {
    // same as iterating a regular `Path` object.
}

Fields

points: &'l [T]closed: bool

Implementations

Returns an iterator of Event<&T>.

Returns an iterator of IdEvent.

Returns an iterator of PathEvent.

Returns the event for a given event ID.

Trait Implementations

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.