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 GeometryCollection<T>> for Valuewhere
T: CoordFloat,
impl<'a, T> From<&'a GeometryCollection<T>> for Valuewhere
T: CoordFloat,
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 LineString<T>> for Valuewhere
T: CoordFloat,
impl<'a, T> From<&'a LineString<T>> for Valuewhere
T: CoordFloat,
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,
impl<'a, T> From<&'a MultiLineString<T>> for Valuewhere
T: CoordFloat,
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,
impl<'a, T> From<&'a MultiPoint<T>> for Valuewhere
T: CoordFloat,
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,
impl<'a, T> From<&'a MultiPolygon<T>> for Valuewhere
T: CoordFloat,
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> 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<T> TryFrom<&Value> for GeometryCollection<T>where
T: CoordFloat,
impl<T> TryFrom<&Value> for GeometryCollection<T>where
T: CoordFloat,
source§impl<T> TryFrom<&Value> for LineString<T>where
T: CoordFloat,
impl<T> TryFrom<&Value> for LineString<T>where
T: CoordFloat,
source§impl<T> TryFrom<&Value> for MultiLineString<T>where
T: CoordFloat,
impl<T> TryFrom<&Value> for MultiLineString<T>where
T: CoordFloat,
source§impl<T> TryFrom<&Value> for MultiPoint<T>where
T: CoordFloat,
impl<T> TryFrom<&Value> for MultiPoint<T>where
T: CoordFloat,
source§impl<T> TryFrom<&Value> for MultiPolygon<T>where
T: CoordFloat,
impl<T> TryFrom<&Value> for MultiPolygon<T>where
T: CoordFloat,
source§impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
source§impl<T: CoordFloat> TryFrom<Value> for LineString<T>
impl<T: CoordFloat> TryFrom<Value> for LineString<T>
source§impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
source§impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
source§impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)