Trait elastic_types::geo::point::GeoPointFormat
[−]
[src]
pub trait GeoPointFormat where
Self: Default, { fn parse<'de, D>(deserializer: D) -> Result<P<f64>, D::Error>
where
D: Deserializer<'de>; fn format<S, TMapping>(
point: &P<f64>,
serializer: S
) -> Result<S::Ok, S::Error>
where
TMapping: GeoPointMapping<Format = Self>,
S: Serializer; }
A format used for parsing and formatting geo points.
Required Methods
fn parse<'de, D>(deserializer: D) -> Result<P<f64>, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Parses a geo::Point
.
This requires access to the full serde
deserializer because geo points can be serialised as
different kinds of complex objects.
fn format<S, TMapping>(point: &P<f64>, serializer: S) -> Result<S::Ok, S::Error> where
TMapping: GeoPointMapping<Format = Self>,
S: Serializer,
TMapping: GeoPointMapping<Format = Self>,
S: Serializer,
Formats a geo::Point
.
This requires access to the full serde
serializer because geo points can be serialised as
different kinds of complex objects.
Formatting also has access to the mapping type, which could be needed to build the structure properly.
Implementors
impl GeoPointFormat for GeoPointObject
impl GeoPointFormat for GeoPointString
impl GeoPointFormat for GeoPointHash
impl GeoPointFormat for GeoPointArray