Struct elastic::types::prelude::GeoShape
[−]
[src]
pub struct GeoShape<M = DefaultGeoShapeMapping> 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,
[src]
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 = GeoShape::new( Geometry::new( Value::Point(vec![ 1.0, 1.0 ]) ) );
fn remap<MInto>(self) -> GeoShape<MInto> where
MInto: GeoShapeMapping,
MInto: GeoShapeMapping,
Change the mapping of this geo shape.
Methods from Deref<Target = Geometry>
Trait Implementations
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> Clone for GeoShape<M> where
M: Clone + GeoShapeMapping,
[src]
M: Clone + GeoShapeMapping,
impl<M> AsRef<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
fn as_ref(&self) -> &Geometry
impl<M> Debug for GeoShape<M> where
M: Debug + GeoShapeMapping,
[src]
M: Debug + GeoShapeMapping,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<M> Serialize for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<M> From<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
impl<'de, M> Deserialize<'de> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
fn deserialize<D>(
deserializer: D
) -> Result<GeoShape<M>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
deserializer: D
) -> Result<GeoShape<M>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl<M> PartialEq<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
impl<M> PartialEq<GeoShape<M>> for GeoShape<M> where
M: PartialEq<M> + GeoShapeMapping,
[src]
M: PartialEq<M> + GeoShapeMapping,
impl<M> GeoShapeFieldType<M> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,