Struct shippo::Address[][src]

pub struct Address {
Show fields pub object_id: String, pub is_complete: bool, pub name: String, pub company: String, pub street1: String, pub street2: String, pub city: String, pub state: String, pub zip: String, pub country: String, pub phone: String, pub email: String, pub test: bool, pub validation_results: ValidationResults,
}

The data type for an address. FROM: https://goshippo.com/docs/reference#addresses

Fields

object_id: String

Unique identifier of the given Address object. This ID is required to create a Shipment object.

is_complete: bool

Complete addresses contain all required values. Incomplete addresses have failed one or multiple validations. Incomplete Addresses are eligible for requesting rates but lack at least one required value for purchasing labels.

name: String

First and Last Name of the addressee

company: String

Company Name

street1: String

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no).

street2: String

Second street line, 35 character limit.

city: String

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates. Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state or a ZIP code (see below), if known, it will yield more accurate results.

state: String

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers only accept two or three character state abbreviations.

zip: String

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more accurate Rates.

country: String

Example: ‘US’ or ‘DE’. All accepted values can be found on the Official ISO Website. Sending a country is always required.

phone: String

Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.

email: String

E-mail address of the contact person, RFC3696/5321-compliant.

test: bool

Indicates whether the object has been created in test mode.

validation_results: ValidationResults

object that contains information regarding if an address had been validated or not. Also contains any messages generated during validation. Children keys are is_valid(boolean) and messages(array).

Implementations

impl Address[src]

pub fn formatted(&self) -> String[src]

Trait Implementations

impl Clone for Address[src]

fn clone(&self) -> Address[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Address[src]

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

Formats the value using the given formatter. Read more

impl Default for Address[src]

fn default() -> Address[src]

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

impl<'de> Deserialize<'de> for Address[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl JsonSchema for Address[src]

fn schema_name() -> String[src]

The name of the generated JSON Schema. Read more

fn json_schema(gen: &mut SchemaGenerator) -> Schema[src]

Generates a JSON Schema for this type. Read more

fn is_referenceable() -> bool[src]

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

impl Serialize for Address[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl RefUnwindSafe for Address

impl Send for Address

impl Sync for Address

impl Unpin for Address

impl UnwindSafe for Address

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> DynClone for T where
    T: Clone
[src]

pub fn __clone_box(&self, Private) -> *mut ()[src]

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]