Trait TriangleTrait

Source
pub trait TriangleTrait: Sized + GeometryTrait {
    type CoordType<'a>: 'a + CoordTrait<T = Self::T>
       where Self: 'a;

    // Required methods
    fn first(&self) -> Self::CoordType<'_>;
    fn second(&self) -> Self::CoordType<'_>;
    fn third(&self) -> Self::CoordType<'_>;

    // Provided method
    fn coords(&self) -> [Self::CoordType<'_>; 3] { ... }
}
Expand description

A trait for accessing data from a generic Triangle.

A triangle is a bounded area whose three vertices are defined by coordinates.

Refer to geo_types::Triangle for information about semantics and validity.

Required Associated Types§

Source

type CoordType<'a>: 'a + CoordTrait<T = Self::T> where Self: 'a

The type of each underlying coordinate, which implements CoordTrait

Required Methods§

Source

fn first(&self) -> Self::CoordType<'_>

Access the first coordinate in this Triangle

Source

fn second(&self) -> Self::CoordType<'_>

Access the second coordinate in this Triangle

Source

fn third(&self) -> Self::CoordType<'_>

Access the third coordinate in this Triangle

Provided Methods§

Source

fn coords(&self) -> [Self::CoordType<'_>; 3]

Access the three underlying coordinates

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: CoordNum> TriangleTrait for &'a Triangle<T>

Source§

type CoordType<'b> = &'a Coord<<&'a Triangle<T> as GeometryTrait>::T> where Self: 'b

Source§

fn first(&self) -> Self::CoordType<'_>

Source§

fn second(&self) -> Self::CoordType<'_>

Source§

fn third(&self) -> Self::CoordType<'_>

Source§

impl<T: CoordNum> TriangleTrait for Triangle<T>

Source§

type CoordType<'a> = &'a Coord<<Triangle<T> as GeometryTrait>::T> where Self: 'a

Source§

fn first(&self) -> Self::CoordType<'_>

Source§

fn second(&self) -> Self::CoordType<'_>

Source§

fn third(&self) -> Self::CoordType<'_>

Implementors§