Trait PointBase

Source
pub trait PointBase<C: CoordinateBase> {
    // Required methods
    fn new(x: C::Coord, y: C::Coord) -> Self;
    fn get(&self, orient: Orientation2D) -> C::Coord;
    fn set(&mut self, orient: Orientation2D, value: C::Coord);

    // Provided methods
    fn x(&self) -> C::Coord { ... }
    fn y(&self) -> C::Coord { ... }
}
Expand description

Basic traits to get and set Kartesian coordinates of a point in the two-dimensional plane.

Required Methods§

Source

fn new(x: C::Coord, y: C::Coord) -> Self

Construct a new point.

Source

fn get(&self, orient: Orientation2D) -> C::Coord

Get a coordinate value.

Source

fn set(&mut self, orient: Orientation2D, value: C::Coord)

Set a coordinate value.

Provided Methods§

Source

fn x(&self) -> C::Coord

Get the x-coordinate value.

Source

fn y(&self) -> C::Coord

Get the y-coordinate value.

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.

Implementors§

Source§

impl<C> PointBase<C> for Point<C::Coord>
where C: CoordinateBase,