Trait Reverse

Source
pub trait Reverse<T>
where T: Float + Debug,
{ // Required method async fn reverse( &self, point: &Point<T>, ) -> Result<Option<String>, GeocodingError>; }
Expand description

Reverse-geocode a coordinate.

This trait represents the most simple and minimal implementation available from a given geocoding provider: some address formatted as Option.

Examples

use geocoding_async::{Opencage, Point, Reverse};

let p = Point::new(2.12870, 41.40139);
let oc = Opencage::new("dcdbf0d783374909b3debee728c7cc10".to_string());
let res = oc.reverse(&p).await.unwrap();
assert_eq!(
    res,
    Some("Carrer de Calatrava, 68, 08017 Barcelona, Spain".to_string())
);

Required Methods§

Source

async fn reverse( &self, point: &Point<T>, ) -> Result<Option<String>, GeocodingError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, T> Reverse<T> for Opencage<'a>

Source§

impl<T> Reverse<T> for GeoAdmin
where for<'de> T: Float + Debug + Deserialize<'de>,

Source§

impl<T> Reverse<T> for Openstreetmap
where for<'de> T: Float + Debug + Deserialize<'de>,