Trait Segment

Source
pub trait Segment<C: CoordinateConcept> {
    type Point: PointConcept<C>;

    // Required method
    fn get_point(&self, dir: Direction1D) -> Self::Point;

    // Provided methods
    fn start(&self) -> Self::Point { ... }
    fn end(&self) -> Self::Point { ... }
}
Expand description

A polygon edge.

Required Associated Types§

Source

type Point: PointConcept<C>

Type used to represent the end points of the segment.

Required Methods§

Source

fn get_point(&self, dir: Direction1D) -> Self::Point

Get the start (LOW) or end (HIGH) point of the segment.

Provided Methods§

Source

fn start(&self) -> Self::Point

Shortcut to get the ‘low’ end of the segment.

Source

fn end(&self) -> Self::Point

Shortcut to get the ‘high’ end of the segment.

Implementors§