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]

[src]

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

[src]

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]

[src]

Formats the value using the given formatter.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

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

[src]

This method tests for !=.

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

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

[src]

Performs the conversion.

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

[src]

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

[src]

This method tests for !=.

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

[src]

Immutably borrows from an owned value. Read more

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more