[][src]Struct elastic_types::geo::shape::GeoShape

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]

pub fn new<I>(geo: I) -> GeoShape<TMapping> where
    I: Into<Geometry>, 
[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 ])
    )
);

pub fn remap<TNewMapping>(shape: GeoShape<TMapping>) -> GeoShape<TNewMapping> where
    TNewMapping: GeoShapeMapping
[src]

Change the mapping of this geo shape.

Methods from Deref<Target = Geometry>

Trait Implementations

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

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

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

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

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

type Target = Geometry

The resulting type after dereferencing.

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

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

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

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

Auto Trait Implementations

impl<TMapping> Send for GeoShape<TMapping> where
    TMapping: Send

impl<TMapping> Sync for GeoShape<TMapping> where
    TMapping: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,