pub enum Value {
Point(PointType),
MultiPoint(Vec<PointType>),
LineString(LineStringType),
MultiLineString(Vec<LineStringType>),
Polygon(PolygonType),
MultiPolygon(Vec<PolygonType>),
GeometryCollection(Vec<Geometry>),
}Expand description
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>)
MultiPoint
LineString(LineStringType)
LineString
MultiLineString(Vec<LineStringType>)
MultiLineString
Polygon(PolygonType)
MultiPolygon(Vec<PolygonType>)
MultiPolygon
GeometryCollection(Vec<Geometry>)
GeometryCollection
Implementations
Trait Implementations
sourceimpl<'a, T> From<&'a Geometry<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Geometry<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<'a, T> From<&'a GeometryCollection<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a GeometryCollection<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourcefn from(geometry_collection: &GeometryCollection<T>) -> Self
fn from(geometry_collection: &GeometryCollection<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a Line<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Line<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<'a, T> From<&'a LineString<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a LineString<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourcefn from(line_string: &LineString<T>) -> Self
fn from(line_string: &LineString<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a MultiLineString<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a MultiLineString<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourcefn from(multi_line_string: &MultiLineString<T>) -> Self
fn from(multi_line_string: &MultiLineString<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a MultiPoint<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a MultiPoint<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourcefn from(multi_point: &MultiPoint<T>) -> Self
fn from(multi_point: &MultiPoint<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a MultiPolygon<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a MultiPolygon<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourcefn from(multi_polygon: &MultiPolygon<T>) -> Self
fn from(multi_polygon: &MultiPolygon<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a Point<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Point<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<'a, T> From<&'a Polygon<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Polygon<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<'a, T> From<&'a Rect<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Rect<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<'a, T> From<&'a Triangle<T>> for Value where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<'a, T> From<&'a Triangle<T>> for Value where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for Point<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for Point<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for MultiPoint<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for MultiPoint<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for LineString<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for LineString<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for MultiLineString<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for MultiLineString<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for Polygon<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for Polygon<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for MultiPolygon<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for MultiPolygon<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for GeometryCollection<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for GeometryCollection<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.sourceimpl<T> TryFrom<Value> for Geometry<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Value> for Geometry<T> where
T: CoordFloat,
This is supported on crate feature
geo-types only.impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more