Reverse

Trait Reverse 

Source
pub trait Reverse<T>
where T: Float + Debug + Send + Sync,
{ // Required method fn reverse<'life0, 'life1, 'async_trait>( &'life0 self, point: &'life1 Point<T>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, GeocodingError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
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::{Opencage, Point, Reverse};

#[tokio::main]
async fn main() {
    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, 64, 08017 Barcelona, Spain".to_string())
    );
}

Required Methods§

Source

fn reverse<'life0, 'life1, 'async_trait>( &'life0 self, point: &'life1 Point<T>, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, GeocodingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

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

Source§

impl<T> Reverse<T> for Opencage<'_>

Source§

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