pub struct PhotonApiClient { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(base_url: &str) -> Self
pub fn new(base_url: &str) -> Self
Creates a new API client with the specified base_url
.
base_url
must begin with http://
or https://
.
Sourcepub fn forward_search(
&self,
query: &str,
filter: Option<ForwardFilter>,
) -> Result<Vec<PhotonFeature>, Box<dyn Error>>
pub fn forward_search( &self, query: &str, filter: Option<ForwardFilter>, ) -> Result<Vec<PhotonFeature>, Box<dyn Error>>
Performs a forward search for the provided query
.
Results can be filtered by the optional filter
. Pass None
for no filter.
This function is blocking, so no async features are involved here. It is, however, safe to call this function in parallel, since the entire API client is thread-safe.
Sourcepub fn reverse_search(
&self,
coords: LatLon,
filter: Option<ReverseFilter>,
) -> Result<Vec<PhotonFeature>, Box<dyn Error>>
pub fn reverse_search( &self, coords: LatLon, filter: Option<ReverseFilter>, ) -> Result<Vec<PhotonFeature>, Box<dyn Error>>
Performs a reverse search for objects at the specified coords
.
Results can be filtered by the optional filter
. Pass None
for no filter.
This function is blocking, so no async features are involved here. It is, however, safe to call this function in parallel, since the entire API client is thread-safe.
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