Trait Forward

Source
pub trait Forward<T>
where T: Float + Debug,
{ // Required method async fn forward( &self, address: &str, ) -> Result<Vec<Point<T>>, GeocodingError>; }
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_async::{Coord, Forward, Opencage, Point};

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

async fn forward(&self, address: &str) -> Result<Vec<Point<T>>, 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> Forward<T> for Opencage<'a>

Source§

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

Source§

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