USPSAddress

Struct USPSAddress 

Source
pub struct USPSAddress {
Show 18 fields pub firmname: Option<String>, pub address1: Option<String>, pub address2: Option<String>, pub city: Option<String>, pub state: Option<String>, pub urbanization: Option<String>, pub zip5: Option<String>, pub zip4: Option<String>, pub city_abbreviation: Option<String>, pub delivery_point: Option<String>, pub carrier_route: Option<String>, pub footnotes: Option<String>, pub dpv_cmra: Option<String>, pub dpv_confirmation: Option<String>, pub dpv_footnotes: Option<String>, pub business: Option<String>, pub central_delivery_point: Option<String>, pub vacant: Option<String>,
}
Expand description

This struct represents a complete US address. None of the fields are required, howver a blank address is not particularly useful.

Fields§

§firmname: Option<String>

The name of the business at the location

§address1: Option<String>

The first line of an address. e.g. 123 Main St

§address2: Option<String>

The second line of an address. e.g. Apt 123

§city: Option<String>

US City

§state: Option<String>

US State. Preferably a two letter abbreviation.

§urbanization: Option<String>

For use in Puerto Rico only

§zip5: Option<String>

5 digit zip code e.g. 12345

§zip4: Option<String>

4 digit zip code extension. e.g. 12345-XXXX

§city_abbreviation: Option<String>

Set upon return from verify_address

§delivery_point: Option<String>

Set upon return from verify_address

§carrier_route: Option<String>

Set upon return from verify_address

§footnotes: Option<String>

Set upon return from verify_address

§dpv_cmra: Option<String>

Set upon return from verify_address

§dpv_confirmation: Option<String>

Set upon return from verify_address

§dpv_footnotes: Option<String>

Set upon return from verify_address

§business: Option<String>

Set upon return from verify_address

§central_delivery_point: Option<String>

Set upon return from verify_address

§vacant: Option<String>

Set upon return from verify_address

Implementations§

Source§

impl USPSAddress

Source

pub fn init( firmname: &str, address_1: &str, address_2: &str, city: &str, state: &str, urbanization: &str, zip5: &str, zip4: &str, ) -> Self

Convenience function to save having to write Some(String::from()) over and over again.

§Example
let address = USPSAddress::init("", "123 Main St.", "", "Big Town", "Washington", "", "99999", "");
Source

pub fn quick( address_1: &str, address_2: &str, city: &str, state: &str, zip5: &str, ) -> Self

Convenience function that only requires common fields to be passed.

§Example
let address = USPSAddress::quick("123 Main St.", "Apt 1", "Seattle", "Washington", "99999");

Trait Implementations§

Source§

impl Debug for USPSAddress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for USPSAddress

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for USPSAddress

Source§

fn eq(&self, other: &USPSAddress) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for USPSAddress

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Err = <U as TryFrom<T>>::Err

Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>