pub struct ReverseGeocode {
pub lon: f64,
pub lat: f64,
}
Expand description
Defines a reverse geocode query
Fields§
§lon: f64
§lat: f64
Implementations§
Source§impl ReverseGeocode
impl ReverseGeocode
Sourcepub async fn search(&self, config: &Config) -> Result<GeocodeResponse, Error>
pub async fn search(&self, config: &Config) -> Result<GeocodeResponse, Error>
Asynchronously reverse geocode
§Example
use osm_rs::nominatim::{Config, ReverseGeocode};
#[tokio::main]
async fn main() {
let c: Config = Config {
url: "https://nominatim.openstreetmap.org/reverse".to_string(),
timeout: 25,
};
let g = ReverseGeocode {
lat: 42.3554334,
lon: -71.060511,
};
let resp = g.search(&c).await.unwrap();
assert_eq!(resp.osm_id, 5331978048);
}
Trait Implementations§
Source§impl Clone for ReverseGeocode
impl Clone for ReverseGeocode
Source§fn clone(&self) -> ReverseGeocode
fn clone(&self) -> ReverseGeocode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ReverseGeocode
impl Debug for ReverseGeocode
Source§impl<'de> Deserialize<'de> for ReverseGeocode
impl<'de> Deserialize<'de> for ReverseGeocode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReverseGeocode
impl RefUnwindSafe for ReverseGeocode
impl Send for ReverseGeocode
impl Sync for ReverseGeocode
impl Unpin for ReverseGeocode
impl UnwindSafe for ReverseGeocode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more