Enum geo_types::Geometry[][src]

pub enum Geometry<T> where
    T: CoordinateType
{ Point(Point<T>), Line(Line<T>), LineString(LineString<T>), Polygon(Polygon<T>), MultiPoint(MultiPoint<T>), MultiLineString(MultiLineString<T>), MultiPolygon(MultiPolygon<T>), GeometryCollection(GeometryCollection<T>), }

An enum representing any possible geometry type.

All Geo types can be converted to a Geometry member using .into() (as part of the std::convert::Into pattern).

Variants

Methods

impl<T: CoordinateType> Geometry<T>
[src]

If this Geometry is a Point, then return that, else None.

use geo_types::*;
let g = Geometry::Point(Point::new(0., 0.));
let p2: Point<f32> = g.as_point().unwrap();
assert_eq!(p2, Point::new(0., 0.,));

If this Geometry is a LineString, then return that LineString, else None.

If this Geometry is a Line, then return that Line, else None.

If this Geometry is a Polygon, then return that, else None.

If this Geometry is a MultiPoint, then return that, else None.

If this Geometry is a MultiLineString, then return that, else None.

If this Geometry is a MultiPolygon, then return that, else None.

Trait Implementations

impl<T: PartialEq> PartialEq for Geometry<T> where
    T: CoordinateType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Clone> Clone for Geometry<T> where
    T: CoordinateType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Geometry<T> where
    T: CoordinateType
[src]

Formats the value using the given formatter. Read more

impl<T: CoordinateType> From<Point<T>> for Geometry<T>
[src]

Performs the conversion.

impl<T: CoordinateType> From<LineString<T>> for Geometry<T>
[src]

Performs the conversion.

impl<T: CoordinateType> From<Polygon<T>> for Geometry<T>
[src]

Performs the conversion.

impl<T: CoordinateType> From<MultiPoint<T>> for Geometry<T>
[src]

Performs the conversion.

impl<T: CoordinateType> From<MultiLineString<T>> for Geometry<T>
[src]

Performs the conversion.

impl<T: CoordinateType> From<MultiPolygon<T>> for Geometry<T>
[src]

Performs the conversion.

Auto Trait Implementations

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

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