pub struct RingRef<'a> { /* private fields */ }Expand description
A borrowed reference to a ring.
Implementations§
Source§impl RingRef<'_>
impl RingRef<'_>
pub fn rect(&self) -> Rect
pub fn num_points(&self) -> usize
pub fn point_at(&self, index: usize) -> Option<Point>
pub fn points(&self) -> &[Point]
pub fn num_segments(&self) -> usize
pub fn segment_at(&self, index: usize) -> Option<Segment>
pub fn convex(&self) -> bool
pub fn clockwise(&self) -> bool
pub fn area(&self) -> f64
pub fn perimeter(&self) -> f64
Sourcepub unsafe fn from_raw(ptr: *const tg_ring) -> Option<Self>
pub unsafe fn from_raw(ptr: *const tg_ring) -> Option<Self>
§Safety
The pointer must be valid for the lifetime 'a.
pub fn as_ptr(&self) -> *const tg_ring
pub fn to_owned(&self) -> Result<Ring>
Trait Implementations§
impl<'a> Copy for RingRef<'a>
impl Send for RingRef<'_>
impl Sync for RingRef<'_>
Auto Trait Implementations§
impl<'a> Freeze for RingRef<'a>
impl<'a> RefUnwindSafe for RingRef<'a>
impl<'a> Unpin for RingRef<'a>
impl<'a> UnwindSafe for RingRef<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)