[−][src]Enum geo_types::Geometry
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
Point(Point<T>)
Line(Line<T>)
LineString(LineString<T>)
Polygon(Polygon<T>)
MultiPoint(MultiPoint<T>)
MultiLineString(MultiLineString<T>)
MultiPolygon(MultiPolygon<T>)
GeometryCollection(GeometryCollection<T>)
Methods
impl<T: CoordinateType> Geometry<T>
[src]
pub fn into_point(self) -> Option<Point<T>>
[src]
If this Geometry is a Point, then return that, else None.
Examples
use geo_types::*; let g = Geometry::Point(Point::new(0., 0.)); let p2: Point<f32> = g.into_point().unwrap(); assert_eq!(p2, Point::new(0., 0.,));
pub fn into_line_string(self) -> Option<LineString<T>>
[src]
If this Geometry is a LineString, then return that LineString, else None.
pub fn into_line(self) -> Option<Line<T>>
[src]
If this Geometry is a Line, then return that Line, else None.
pub fn into_polygon(self) -> Option<Polygon<T>>
[src]
If this Geometry is a Polygon, then return that, else None.
pub fn into_multi_point(self) -> Option<MultiPoint<T>>
[src]
If this Geometry is a MultiPoint, then return that, else None.
pub fn into_multi_line_string(self) -> Option<MultiLineString<T>>
[src]
If this Geometry is a MultiLineString, then return that, else None.
pub fn into_multi_polygon(self) -> Option<MultiPolygon<T>>
[src]
If this Geometry is a MultiPolygon, then return that, else None.
Trait Implementations
impl<T: Clone> Clone for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn clone(&self) -> Geometry<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: CoordinateType> From<Point<T>> for Geometry<T>
[src]
impl<T: CoordinateType> From<Line<T>> for Geometry<T>
[src]
impl<T: CoordinateType> From<LineString<T>> for Geometry<T>
[src]
fn from(x: LineString<T>) -> Geometry<T>
[src]
impl<T: CoordinateType> From<Polygon<T>> for Geometry<T>
[src]
impl<T: CoordinateType> From<MultiPoint<T>> for Geometry<T>
[src]
fn from(x: MultiPoint<T>) -> Geometry<T>
[src]
impl<T: CoordinateType> From<MultiLineString<T>> for Geometry<T>
[src]
fn from(x: MultiLineString<T>) -> Geometry<T>
[src]
impl<T: CoordinateType> From<MultiPolygon<T>> for Geometry<T>
[src]
fn from(x: MultiPolygon<T>) -> Geometry<T>
[src]
impl<T: PartialEq> PartialEq<Geometry<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T: Debug> Debug for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,