Struct geo_types::Coordinate [−][src]
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.
Fields
x: T
y: T
Methods
impl<T> Coordinate<T> where
T: CoordinateType + ToPrimitive,
[src]
impl<T> Coordinate<T> where
T: CoordinateType + ToPrimitive,
pub fn x_y(&self) -> (T, T)
[src]
pub fn x_y(&self) -> (T, T)
Returns a tuple that contains the x/horizontal & y/vertical component of the coordinate.
Examples
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: PartialEq> PartialEq for Coordinate<T> where
T: CoordinateType,
[src]
impl<T: PartialEq> PartialEq for Coordinate<T> where
T: CoordinateType,
fn eq(&self, other: &Coordinate<T>) -> bool
[src]
fn eq(&self, other: &Coordinate<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Coordinate<T>) -> bool
[src]
fn ne(&self, other: &Coordinate<T>) -> bool
This method tests for !=
.
impl<T: Clone> Clone for Coordinate<T> where
T: CoordinateType,
[src]
impl<T: Clone> Clone for Coordinate<T> where
T: CoordinateType,
fn clone(&self) -> Coordinate<T>
[src]
fn clone(&self) -> Coordinate<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Coordinate<T> where
T: CoordinateType,
[src]
impl<T: Copy> Copy for Coordinate<T> where
T: CoordinateType,
impl<T: Debug> Debug for Coordinate<T> where
T: CoordinateType,
[src]
impl<T: Debug> Debug for Coordinate<T> where
T: CoordinateType,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: CoordinateType> From<(T, T)> for Coordinate<T>
[src]
impl<T: CoordinateType> From<(T, T)> for Coordinate<T>
impl<T: CoordinateType> From<[T; 2]> for Coordinate<T>
[src]
impl<T: CoordinateType> From<[T; 2]> for Coordinate<T>
impl<T: CoordinateType> From<Point<T>> for Coordinate<T>
[src]
impl<T: CoordinateType> From<Point<T>> for Coordinate<T>
impl<T: CoordinateType> From<Coordinate<T>> for Point<T>
[src]
impl<T: CoordinateType> From<Coordinate<T>> for Point<T>
fn from(x: Coordinate<T>) -> Point<T>
[src]
fn from(x: Coordinate<T>) -> Point<T>
Performs the conversion.
Auto Trait Implementations
impl<T> Send for Coordinate<T> where
T: Send,
impl<T> Send for Coordinate<T> where
T: Send,
impl<T> Sync for Coordinate<T> where
T: Sync,
impl<T> Sync for Coordinate<T> where
T: Sync,