pub struct GeoShape<TMapping>where
TMapping: GeoShapeMapping,{ /* private fields */ }
Expand description
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 ])
)
);
Implementations§
Source§impl<TMapping> GeoShape<TMapping>where
TMapping: GeoShapeMapping,
impl<TMapping> GeoShape<TMapping>where
TMapping: GeoShapeMapping,
Sourcepub fn new<I>(geo: I) -> GeoShape<TMapping>
pub fn new<I>(geo: I) -> GeoShape<TMapping>
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 ])
)
);
Sourcepub fn remap<TNewMapping>(shape: GeoShape<TMapping>) -> GeoShape<TNewMapping>where
TNewMapping: GeoShapeMapping,
pub fn remap<TNewMapping>(shape: GeoShape<TMapping>) -> GeoShape<TNewMapping>where
TNewMapping: GeoShapeMapping,
Change the mapping of this geo shape.
Trait Implementations§
Source§impl<M> Deref for GeoShape<M>where
M: GeoShapeMapping,
impl<M> Deref for GeoShape<M>where
M: GeoShapeMapping,
Source§impl<'de, TMapping> Deserialize<'de> for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
impl<'de, TMapping> Deserialize<'de> for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
Source§fn deserialize<D>(deserializer: D) -> Result<GeoShape<TMapping>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<GeoShape<TMapping>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<TMapping> Serialize for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
impl<TMapping> Serialize for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
impl<TMapping> GeoShapeFieldType<TMapping> for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
impl<TMapping> StructuralPartialEq for GeoShape<TMapping>where
TMapping: GeoShapeMapping,
Auto Trait Implementations§
impl<TMapping> Freeze for GeoShape<TMapping>
impl<TMapping> RefUnwindSafe for GeoShape<TMapping>where
TMapping: RefUnwindSafe,
impl<TMapping> Send for GeoShape<TMapping>where
TMapping: Send,
impl<TMapping> Sync for GeoShape<TMapping>where
TMapping: Sync,
impl<TMapping> Unpin for GeoShape<TMapping>where
TMapping: Unpin,
impl<TMapping> UnwindSafe for GeoShape<TMapping>where
TMapping: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.