[][src]Struct geohash::Coordinate

pub struct Coordinate<T> where
    T: CoordinateType
{ pub x: T, pub y: T, }

A lightweight struct used to store coordinates on the 2-dimensional Cartesian plane.

Unlike Point (which in the future may contain additional information such as an envelope, a precision model, and spatial reference system information), a Coordinate only contains ordinate values and accessor methods.


x: Ty: T


impl<T> Coordinate<T> where
    T: CoordinateType

pub fn x_y(&self) -> (T, T)[src]

Returns a tuple that contains the x/horizontal & y/vertical component of the coordinate.


use geo_types::Coordinate;

let c = Coordinate {
    x: 40.02f64,
    y: 116.34,
let (x, y) = c.x_y();

assert_eq!(y, 116.34);
assert_eq!(x, 40.02f64);

Trait Implementations

impl<T> Clone for Coordinate<T> where
    T: Clone + CoordinateType

impl<T> Copy for Coordinate<T> where
    T: Copy + CoordinateType

impl<T> Debug for Coordinate<T> where
    T: Debug + CoordinateType

impl<T> Eq for Coordinate<T> where
    T: Eq + CoordinateType

impl<T> From<[T; 2]> for Coordinate<T> where
    T: CoordinateType

impl<T> From<(T, T)> for Coordinate<T> where
    T: CoordinateType

impl<T> From<Point<T>> for Coordinate<T> where
    T: CoordinateType

impl<T> Hash for Coordinate<T> where
    T: Hash + CoordinateType

impl<T> PartialEq<Coordinate<T>> for Coordinate<T> where
    T: PartialEq<T> + CoordinateType

Auto Trait Implementations

impl<T> RefUnwindSafe for Coordinate<T> where
    T: RefUnwindSafe

impl<T> Send for Coordinate<T> where
    T: Send

impl<T> Sync for Coordinate<T> where
    T: Sync

impl<T> Unpin for Coordinate<T> where
    T: Unpin

impl<T> UnwindSafe for Coordinate<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.