pub struct Geocoder { /* private fields */ }
Implementations§
Source§impl Geocoder
impl Geocoder
Sourcepub async fn geocode(
&self,
location: &str,
) -> Result<GeocodeResponse, GeocoderError>
pub async fn geocode( &self, location: &str, ) -> Result<GeocodeResponse, GeocoderError>
Geocodes a location string to an address.
§Arguments
location
- A string slice that holds the location to geocode.
§Returns
A Result
which is:
Ok
containing anAddress
if the geocoding is successful.Err
containing aGeocoderError
if there is an error.
§Errors
This function will return an error if the request fails, the response cannot be parsed, or if the address is not found.
Auto Trait Implementations§
impl Freeze for Geocoder
impl !RefUnwindSafe for Geocoder
impl Send for Geocoder
impl Sync for Geocoder
impl Unpin for Geocoder
impl !UnwindSafe for Geocoder
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