Poly

Struct Poly 

Source
pub struct Poly { /* private fields */ }
Expand description

An owned polygon.

Implementations§

Source§

impl Poly

Source

pub fn rect(&self) -> Rect

Source

pub fn num_holes(&self) -> usize

Source

pub fn clockwise(&self) -> bool

Source

pub fn exterior(&self) -> RingRef<'_>

Source

pub fn hole_at(&self, index: usize) -> Option<RingRef<'_>>

Source

pub fn new(exterior: &Ring, holes: &[&Ring]) -> Result<Self>

Source

pub fn new_simple(exterior: &Ring) -> Result<Self>

Source

pub unsafe fn from_raw(ptr: *mut tg_poly) -> Option<Self>

§Safety

The pointer must be valid and not owned elsewhere.

Source

pub fn as_ptr(&self) -> *const tg_poly

Source

pub fn into_raw(self) -> *mut tg_poly

Source

pub fn copy(&self) -> Result<Self>

Source

pub fn clone_ref(&self) -> Result<Self>

Source

pub fn memsize(&self) -> usize

Source

pub fn iter_holes(&self) -> impl Iterator<Item = RingRef<'_>>

Trait Implementations§

Source§

impl Debug for Poly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Poly

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Poly

Source§

impl Sync for Poly

Auto Trait Implementations§

§

impl Freeze for Poly

§

impl RefUnwindSafe for Poly

§

impl Unpin for Poly

§

impl UnwindSafe for Poly

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.