Trait geocoding::Forward
[−]
[src]
pub trait Forward<T> where
T: Float, { fn forward(&self, address: &str) -> Result<Vec<Point<T>>>; }
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::Point; use geocoding::Forward; use geocoding::Opencage; let p = Point::new(2.12870, 41.40139); let oc = Opencage::new("dcdbf0d783374909b3debee728c7cc10".to_string()); let address = "Schwabing, München"; let res = oc.forward(&address); assert_eq!( res.unwrap(), vec![ Point::new(11.5761796, 48.1599218), Point::new(11.57583, 48.1608265), ] );
Required Methods
Implementors
impl<T> Forward<T> for Opencage where
T: Float,
T: Deserialize<'de>,