Coord

Trait Coord 

Source
pub trait Coord {
    // Required methods
    fn x(&self) -> f64;
    fn y(&self) -> f64;
    fn with_xy(_: f64, _: f64) -> Self;
}
Expand description

A trait for everything that can be treated as a coordinate for a projection.

Implement this trait if you have a custom type to be able to project to and from it directly.

There exist an impl for this for (f64, f64) out of the box (formatted as (x, y), or (lon, lat)).

Required Methods§

Source

fn x(&self) -> f64

Return the first of the f64 pair.

Source

fn y(&self) -> f64

Return the second of the f64 pair.

Source

fn with_xy(_: f64, _: f64) -> Self

Construct a new Coord implementation from two f64.

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 Coord for (f64, f64)

Source§

fn x(&self) -> f64

Source§

fn y(&self) -> f64

Source§

fn with_xy(x: f64, y: f64) -> (f64, f64)

Implementors§