pub trait Forward<T>{
// 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§
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.