Forward

Trait Forward 

Source
pub trait Forward<T>
where T: Float + Debug + Send + Sync,
{ // Required method fn forward<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Point<T>>, GeocodingError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
Expand description

Forward-geocode a coordinate.

This trait represents the most simple and minimal implementation available from a given geocoding provider: It returns a Vec of zero or more Points.

Examples

use geocoding::{Coord, Forward, Opencage, Point};

#[tokio::main]
async fn main() {
    let oc = Opencage::new("dcdbf0d783374909b3debee728c7cc10".to_string());
    let address = "Schwabing, München";
    let res: Vec<Point<f64>> = oc.forward(address).await.unwrap();
    assert_eq!(
        res,
        vec![Point(Coord { x: 11.5884858, y: 48.1700887 })]
    );
}

Required Methods§

Source

fn forward<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Point<T>>, GeocodingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

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

Source§

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

Source§

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