Trait LineTrait

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

    // Required methods
    fn start(&self) -> Self::CoordType<'_>;
    fn end(&self) -> Self::CoordType<'_>;

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

A trait for accessing data from a generic Line.

A Line is a line segment made up of exactly two coordinates.

Refer to geo_types::Line 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 start(&self) -> Self::CoordType<'_>

Access the start coordinate in this Line

Source

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

Access the start coordinate in this Line

Provided Methods§

Source

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

Access the two 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> LineTrait for &'a Line<T>

Source§

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

Source§

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

Source§

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

Source§

impl<T: CoordNum> LineTrait for Line<T>

Source§

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

Source§

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

Source§

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

Implementors§