Struct plotters::element::Polygon[][src]

pub struct Polygon<Coord> { /* fields omitted */ }
Expand description

An element of a filled polygon

Implementations

impl<Coord> Polygon<Coord>[src]

pub fn new<P: Into<Vec<Coord>>, S: Into<ShapeStyle>>(
    points: P,
    style: S
) -> Self
[src]

Create a new polygon

  • points: The iterator of the points
  • style: The shape style
  • returns the created element

Trait Implementations

impl<Coord, DB: DrawingBackend> Drawable<DB, BackendCoordOnly> for Polygon<Coord>[src]

fn draw<I: Iterator<Item = BackendCoord>>(
    &self,
    points: I,
    backend: &mut DB,
    _: (u32, u32)
) -> Result<(), DrawingErrorKind<DB::ErrorType>>
[src]

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

impl<'a, Coord> PointCollection<'a, Coord, BackendCoordOnly> for &'a Polygon<Coord>[src]

type Point = &'a Coord

The item in point iterator

type IntoIter = &'a [Coord]

The point iterator

fn point_iter(self) -> &'a [Coord][src]

framework to do the coordinate mapping

Auto Trait Implementations

impl<Coord> RefUnwindSafe for Polygon<Coord> where
    Coord: RefUnwindSafe

impl<Coord> Send for Polygon<Coord> where
    Coord: Send

impl<Coord> Sync for Polygon<Coord> where
    Coord: Sync

impl<Coord> Unpin for Polygon<Coord> where
    Coord: Unpin

impl<Coord> UnwindSafe for Polygon<Coord> where
    Coord: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

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

Performs the conversion.