pub struct ZipCodeStackClient { /* private fields */ }Expand description
Async client for the zipcodestack.com API.
Implementations§
Source§impl ZipCodeStackClient
impl ZipCodeStackClient
Sourcepub fn builder<S: Into<String>>(api_key: S) -> ZipCodeStackClientBuilder
pub fn builder<S: Into<String>>(api_key: S) -> ZipCodeStackClientBuilder
Start building a ZipCodeStackClient.
Sourcepub async fn status(&self) -> Result<StatusResponse, ZipCodeStackError>
pub async fn status(&self) -> Result<StatusResponse, ZipCodeStackError>
Query the API status and (optionally) quota usage.
Endpoint path used: /status
Sourcepub async fn search_zip(
&self,
zip_code: &str,
country: Option<&str>,
) -> Result<ZipSearchResponse, ZipCodeStackError>
pub async fn search_zip( &self, zip_code: &str, country: Option<&str>, ) -> Result<ZipSearchResponse, ZipCodeStackError>
Search for details about a zip/postal code.
Endpoint path used: /search
Supported query params: zip_code, optional country
Sourcepub async fn distance_between(
&self,
from_zip: &str,
to_zip: &str,
unit: Option<DistanceUnit>,
) -> Result<DistanceResponse, ZipCodeStackError>
pub async fn distance_between( &self, from_zip: &str, to_zip: &str, unit: Option<DistanceUnit>, ) -> Result<DistanceResponse, ZipCodeStackError>
Compute distance between two zip/postal codes.
Endpoint path used: /distance
Supported query params: from, to, optional unit (“miles” | “kilometers”)
Auto Trait Implementations§
impl Freeze for ZipCodeStackClient
impl !RefUnwindSafe for ZipCodeStackClient
impl Send for ZipCodeStackClient
impl Sync for ZipCodeStackClient
impl Unpin for ZipCodeStackClient
impl !UnwindSafe for ZipCodeStackClient
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