[−][src]Struct usps_api::USPSWebTool
This struct is how you will make API calls to the USPS. It can be initialized with a hardcoded user_id and password using the 'init' contructor or it can attempt to capture these values from the environment (USPS_USER_ID and USPS_PASSWORD respectively) using the 'new' constructor.
Methods
impl USPSWebTool
[src]
pub fn init(user_id: &str, password: &str) -> Self
[src]
Used to build a new USPSWebTool struct by specifying the USPS authentication credentials directly."
Example
let usps_api = USPSWebTool::init("XXXX", "YYYY");
pub fn new() -> Result<Self, VarError>
[src]
Used to build a new USPSWebTool struct by looking at the environment variables "USPS_USER_ID" and "USPS_PASSWORD to specify the USPS authentication credentials."
Example
env::set_var("USPS_USER_ID", "XXXX"); env::set_var("USPS_PASSWORD", "YYYY"); let usps_api = USPSWebTool::new()?;
pub fn use_http(self) -> Self
[src]
Will use the unsecured endpoint for communication with the USPS API. This feature is not recommended.
Example
let usps_api = USPSWebTool::init("XXXX", "YYYY").use_http();
pub fn verify_address(
&self,
address: USPSAddress
) -> Result<USPSAddress, Box<dyn Error>>
[src]
&self,
address: USPSAddress
) -> Result<USPSAddress, Box<dyn Error>>
Accepts a USPS Address and returns a result with the 'correct' form of the address.
Trait Implementations
impl PartialEq<USPSWebTool> for USPSWebTool
[src]
fn eq(&self, other: &USPSWebTool) -> bool
[src]
fn ne(&self, other: &USPSWebTool) -> bool
[src]
impl Debug for USPSWebTool
[src]
Auto Trait Implementations
impl Sync for USPSWebTool
impl Send for USPSWebTool
impl Unpin for USPSWebTool
impl UnwindSafe for USPSWebTool
impl RefUnwindSafe for USPSWebTool
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,