pub struct Polygon { /* private fields */ }Expand description
A polygon spawned by coordinates.
Implementations§
Source§impl Polygon
impl Polygon
Sourcepub fn push(&mut self, coord: Coordinate)
pub fn push(&mut self, coord: Coordinate)
Appends a coordinate to the back of the coordinates.
Sourcepub fn contains(&self, point: &Coordinate) -> bool
pub fn contains(&self, point: &Coordinate) -> bool
Returns true if the given point is within the polygon’s area.
Sourcepub fn into_inner(self) -> Vec<Coordinate>
pub fn into_inner(self) -> Vec<Coordinate>
Consumes the Polygon, returning its inner vector of coordinates.
Trait Implementations§
Source§impl From<Vec<Coordinate>> for Polygon
impl From<Vec<Coordinate>> for Polygon
Source§fn from(coords: Vec<Coordinate>) -> Self
fn from(coords: Vec<Coordinate>) -> Self
Converts to this type from the input type.
Source§impl PartialOrd for Polygon
impl PartialOrd for Polygon
impl StructuralPartialEq for Polygon
Auto Trait Implementations§
impl Freeze for Polygon
impl RefUnwindSafe for Polygon
impl Send for Polygon
impl Sync for Polygon
impl Unpin for Polygon
impl UnwindSafe for Polygon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more