Struct elastic_types::geo::shape::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]

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 ])
    )
);

Change the mapping of this geo shape.

Methods from Deref<Target = Geometry>

Trait Implementations

impl<M: Debug> Debug for GeoShape<M> where
    M: GeoShapeMapping
[src]

Formats the value using the given formatter.

impl<M: Clone> Clone for GeoShape<M> where
    M: GeoShapeMapping
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<M: PartialEq> PartialEq for GeoShape<M> where
    M: GeoShapeMapping
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<M> GeoShapeFieldType<M> for GeoShape<M> where
    M: GeoShapeMapping
[src]

impl<M> From<Geometry> for GeoShape<M> where
    M: GeoShapeMapping
[src]

Performs the conversion.

impl<M> AsRef<Geometry> for GeoShape<M> where
    M: GeoShapeMapping
[src]

Performs the conversion.

impl<M> PartialEq<Geometry> for GeoShape<M> where
    M: GeoShapeMapping
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<M> Deref for GeoShape<M> where
    M: GeoShapeMapping
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<M> Serialize for GeoShape<M> where
    M: GeoShapeMapping
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de, M> Deserialize<'de> for GeoShape<M> where
    M: GeoShapeMapping
[src]

Deserialize this value from the given Serde deserializer. Read more