pub struct Client {
pub timeout: Duration,
/* private fields */
}
Expand description
The interface for accessing a Nominatim API server.
Fields§
§timeout: Duration
HTTP Request Timeout Duration
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(ident: IdentificationMethod) -> Self
pub fn new(ident: IdentificationMethod) -> Self
Create a new Client
from an IdentificationMethod
.
Sourcepub fn set_base_url<U: TryInto<Url>>(&mut self, url: U) -> Result<(), U::Error>
pub fn set_base_url<U: TryInto<Url>>(&mut self, url: U) -> Result<(), U::Error>
Set the client’s internal base url for all requests.
Sourcepub async fn search(&self, query: impl AsRef<str>) -> Result<Vec<Place>, Error>
pub async fn search(&self, query: impl AsRef<str>) -> Result<Vec<Place>, Error>
Get Place
s from a search query.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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