Enum geojson::Value[][src]

pub enum Value {
    Point(PointType),
    MultiPoint(Vec<PointType>),
    LineString(LineStringType),
    MultiLineString(Vec<LineStringType>),
    Polygon(PolygonType),
    MultiPolygon(Vec<PolygonType>),
    GeometryCollection(Vec<Geometry>),
}

The underlying value for a Geometry.

Conversion from geo_types

A Value can be created by using the From impl which is available for both geo_types primitives AND geo_types::Geometry enum members:

let point = geo_types::Point::new(2., 9.);
let genum = geo_types::Geometry::from(point);
assert_eq!(
    geojson::Value::from(&point),
    geojson::Value::Point(vec![2., 9.]),
);
assert_eq!(
    geojson::Value::from(&genum),
    geojson::Value::Point(vec![2., 9.]),
);

Variants

Point(PointType)
MultiPoint(Vec<PointType>)
LineString(LineStringType)
MultiLineString(Vec<LineStringType>)
Polygon(PolygonType)
MultiPolygon(Vec<PolygonType>)
GeometryCollection(Vec<Geometry>)

Implementations

impl Value[src]

pub fn from_json_object(object: Map<String, JsonValue>) -> Result<Self, Error>[src]

pub fn from_json_value(value: JsonValue) -> Result<Self, Error>[src]

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl<'a, T> From<&'a Geometry<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

fn from(geometry: &'a Geometry<T>) -> Self[src]

Convert from geo_types::Geometry enums

impl<'a, T> From<&'a GeometryCollection<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a Line<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a LineString<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a MultiLineString<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a MultiPoint<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a MultiPolygon<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a Point<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a Polygon<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a Rect<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a, T> From<&'a Triangle<T>> for Value where
    T: CoordFloat
[src]

This is supported on crate feature geo-types only.

impl<'a> From<&'a Value> for Map<String, JsonValue>[src]

impl<'a> From<&'a Value> for JsonValue[src]

impl PartialEq<Value> for Value[src]

impl Serialize for Value[src]

impl StructuralPartialEq for Value[src]

impl TryFrom<Map<String, Value>> for Value[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Value> for Value[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.