Struct elastic_types::geo::shape::GeoShape
[−]
pub struct GeoShape<M> where
M: GeoShapeMapping, { /* fields omitted */ }
Geo shape type with a given mapping.
Defining a geo_shape
with a mapping:
extern crate geojson; use geojson::{ Geometry, Value }; let point: GeoShape<DefaultGeoShapeMapping> = GeoShape::new( Geometry::new( Value::Point(vec![ 1.0, 1.0 ]) ) );
Methods
impl<M> GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
fn new<I>(geo: I) -> GeoShape<M> where
I: Into<Geometry>,
I: Into<Geometry>,
Creates a new GeoShape
from the given Geometry
.
This function will consume the provided Geometry
.
Examples
use geojson::{ Geometry, Value }; let point: GeoShape<DefaultGeoShapeMapping> = GeoShape::new( Geometry::new( Value::Point(vec![ 1.0, 1.0 ]) ) );
fn remap<MInto>(shape: GeoShape<M>) -> GeoShape<MInto> where
MInto: GeoShapeMapping,
MInto: GeoShapeMapping,
Change the mapping of this geo shape.
Methods from Deref<Target = Geometry>
Trait Implementations
impl<M: Debug> Debug for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
impl<M: Clone> Clone for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
fn clone(&self) -> GeoShape<M>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<M: PartialEq> PartialEq for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
fn eq(&self, __arg_0: &GeoShape<M>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &GeoShape<M>) -> bool
This method tests for !=
.
impl<M> GeoShapeFieldType<M> for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
impl<M> From<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
impl<M> PartialEq<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
fn eq(&self, other: &Geometry) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Geometry) -> bool
This method tests for !=
.
impl<M> Deref for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
type Target = Geometry
The resulting type after dereferencing
fn deref(&self) -> &Geometry
The method called to dereference a value
impl<M> Borrow<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
impl<M> Serialize for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de, M> Deserialize<'de> for GeoShape<M> where
M: GeoShapeMapping,
M: GeoShapeMapping,
fn deserialize<D>(deserializer: D) -> Result<GeoShape<M>, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more