Struct elastic_types::geo::shape::GeoShape
[−]
[src]
pub struct GeoShape<TMapping> where
TMapping: 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<TMapping> GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
fn new<I>(geo: I) -> GeoShape<TMapping> where
I: Into<Geometry>,
[src]
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<TNewMapping>(shape: GeoShape<TMapping>) -> GeoShape<TNewMapping> where
TNewMapping: GeoShapeMapping,
[src]
TNewMapping: GeoShapeMapping,
Change the mapping of this geo shape.
Methods from Deref<Target = Geometry>
Trait Implementations
impl<TMapping: Debug> Debug for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
impl<TMapping: Clone> Clone for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
fn clone(&self) -> GeoShape<TMapping>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<TMapping: PartialEq> PartialEq for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
fn eq(&self, __arg_0: &GeoShape<TMapping>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &GeoShape<TMapping>) -> bool
[src]
This method tests for !=
.
impl<TMapping> GeoShapeFieldType<TMapping> for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: 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
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Geometry) -> bool
[src]
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
[src]
Dereferences the value.
impl<M> Borrow<Geometry> for GeoShape<M> where
M: GeoShapeMapping,
[src]
M: GeoShapeMapping,
impl<TMapping> Serialize for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de, TMapping> Deserialize<'de> for GeoShape<TMapping> where
TMapping: GeoShapeMapping,
[src]
TMapping: GeoShapeMapping,
fn deserialize<D>(deserializer: D) -> Result<GeoShape<TMapping>, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more