pub enum SubaddressType {
Show 26 variants
Apartment,
Basement,
Building,
Department,
Floor,
Front,
Hanger,
Key,
Lobby,
Lot,
Lower,
Office,
Penthouse,
Pier,
Rear,
Room,
Side,
Slip,
Space,
Stop,
Suite,
Trailer,
Unit,
Upper,
Rec,
Laundry,
}Expand description
The SubaddressType enum represents the subaddress type of an address. Valid type
designations include the list of secondary unit designators in Appendix C2 of the United States
Postal Service (USPS) Publication 28 - Postal Addressing Standards.
Variants§
Apartment
Basement
Building
Department
Floor
Front
Hanger
Key
Lobby
Lot
Lower
Office
Penthouse
Pier
Rear
Room
Side
Slip
Space
Stop
Suite
Trailer
Unit
Upper
Rec
Recreation room. A shared space common to apartment complexes.
Laundry
Laundry room. A shared space common to apartment complexes.
Implementations§
Source§impl SubaddressType
impl SubaddressType
Sourcepub fn upper(&self) -> String
pub fn upper(&self) -> String
The upper method converts the variant name to UPPERCASE case using
convert_case::Case::Upper.
Sourcepub fn abbreviate(&self) -> String
pub fn abbreviate(&self) -> String
The abbreviate method returns a String with the postal abbreviation of the subaddress
type.
Sourcepub fn match_abbreviated(input: &str) -> Option<Self>
pub fn match_abbreviated(input: &str) -> Option<Self>
Matches subaddress types in the
data that observe the official postal contraction. For subaddress types with a mix of abbreviations and
alternative spellings, the match_mixed method will work better.
Sourcepub fn deserialize_abbreviated<'de, D: Deserializer<'de>>(
de: D,
) -> Result<Option<Self>, D::Error>
pub fn deserialize_abbreviated<'de, D: Deserializer<'de>>( de: D, ) -> Result<Option<Self>, D::Error>
Deserialization function for subaddress types. This works if all the subaddress types in the
data observe the official postal contraction. For subaddress types with a mix of abbreviations and
alternative spellings, Self::match_mixed will work better.
Sourcepub fn match_mixed(input: &str) -> Option<Self>
pub fn match_mixed(input: &str) -> Option<Self>
Matches the target data against novel spellings of valid subaddress types. Add any missing spelling
variants to the match statement. Called by [crate::Parser::subaddress_type].
Add additional variants to accommodate alternative abbreviations as needed.
Sourcepub fn deserialize_mixed<'de, D: Deserializer<'de>>(
de: D,
) -> Result<Option<Self>, D::Error>
pub fn deserialize_mixed<'de, D: Deserializer<'de>>( de: D, ) -> Result<Option<Self>, D::Error>
The deserialize_mixed_subaddress_type function attempts to deserialize the input data into a
SubaddressType.
Trait Implementations§
Source§impl Clone for SubaddressType
impl Clone for SubaddressType
Source§fn clone(&self) -> SubaddressType
fn clone(&self) -> SubaddressType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubaddressType
impl Debug for SubaddressType
Source§impl Default for SubaddressType
impl Default for SubaddressType
Source§fn default() -> SubaddressType
fn default() -> SubaddressType
Source§impl<'de> Deserialize<'de> for SubaddressType
impl<'de> Deserialize<'de> for SubaddressType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SubaddressType
impl Display for SubaddressType
Source§impl FromStr for SubaddressType
impl FromStr for SubaddressType
Source§impl Hash for SubaddressType
impl Hash for SubaddressType
Source§impl IntoEnumIterator for SubaddressType
impl IntoEnumIterator for SubaddressType
Source§impl Ord for SubaddressType
impl Ord for SubaddressType
Source§fn cmp(&self, other: &SubaddressType) -> Ordering
fn cmp(&self, other: &SubaddressType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SubaddressType
impl PartialEq for SubaddressType
Source§impl PartialOrd for SubaddressType
impl PartialOrd for SubaddressType
Source§impl Serialize for SubaddressType
impl Serialize for SubaddressType
impl Copy for SubaddressType
impl Eq for SubaddressType
impl StructuralPartialEq for SubaddressType
Auto Trait Implementations§
impl Freeze for SubaddressType
impl RefUnwindSafe for SubaddressType
impl Send for SubaddressType
impl Sync for SubaddressType
impl Unpin for SubaddressType
impl UnwindSafe for SubaddressType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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