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§
source§impl Value
impl Value
pub fn from_json_object(object: JsonObject) -> Result<Self>
pub fn from_json_value(value: JsonValue) -> Result<Self>
Trait Implementations§
source§impl<'a, T> From<&'a Geometry<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Geometry<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a, T> From<&'a GeometryCollection<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a GeometryCollection<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§fn from(geometry_collection: &GeometryCollection<T>) -> Self
fn from(geometry_collection: &GeometryCollection<T>) -> Self
Converts to this type from the input type.
source§impl<'a, T> From<&'a Line<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Line<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a, T> From<&'a LineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a LineString<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§fn from(line_string: &LineString<T>) -> Self
fn from(line_string: &LineString<T>) -> Self
Converts to this type from the input type.
source§impl<'a, T> From<&'a MultiLineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a MultiLineString<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§fn from(multi_line_string: &MultiLineString<T>) -> Self
fn from(multi_line_string: &MultiLineString<T>) -> Self
Converts to this type from the input type.
source§impl<'a, T> From<&'a MultiPoint<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a MultiPoint<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§fn from(multi_point: &MultiPoint<T>) -> Self
fn from(multi_point: &MultiPoint<T>) -> Self
Converts to this type from the input type.
source§impl<'a, T> From<&'a MultiPolygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a MultiPolygon<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§fn from(multi_polygon: &MultiPolygon<T>) -> Self
fn from(multi_polygon: &MultiPolygon<T>) -> Self
Converts to this type from the input type.
source§impl<'a, T> From<&'a Point<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Point<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a, T> From<&'a Polygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Polygon<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a, T> From<&'a Rect<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Rect<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a, T> From<&'a Triangle<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types
only.
impl<'a, T> From<&'a Triangle<T>> for Valuewhere T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<'a> From<&'a Value> for JsonObject
impl<'a> From<&'a Value> for JsonObject
source§fn from(value: &'a Value) -> JsonObject
fn from(value: &'a Value) -> JsonObject
Converts to this type from the input type.
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl<T> TryFrom<&Value> for Geometry<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for Geometry<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for GeometryCollection<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for GeometryCollection<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for LineString<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for LineString<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for MultiLineString<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for MultiLineString<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for MultiPoint<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for MultiPoint<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for MultiPolygon<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for MultiPolygon<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for Point<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for Point<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T> TryFrom<&Value> for Polygon<T>where
T: CoordFloat,
Available on crate feature geo-types
only.
impl<T> TryFrom<&Value> for Polygon<T>where T: CoordFloat,
Available on crate feature
geo-types
only.source§impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
Available on crate feature geo-types
only.
impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
Available on crate feature
geo-types
only.source§impl<T: CoordFloat> TryFrom<Value> for LineString<T>
Available on crate feature geo-types
only.
impl<T: CoordFloat> TryFrom<Value> for LineString<T>
Available on crate feature
geo-types
only.source§impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
Available on crate feature geo-types
only.
impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
Available on crate feature
geo-types
only.source§impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
Available on crate feature geo-types
only.
impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
Available on crate feature
geo-types
only.source§impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
Available on crate feature geo-types
only.
impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
Available 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more