pub struct ParsedAddressLine {
pub house_number: Option<String>,
pub unit: Option<String>,
pub street: String,
}Expand description
Structured decomposition of a postal-address line.
Produced by Normalizer::parse_address_line. The struct is
Serialize + Deserialize so it round-trips through JSON and can be
embedded in downstream data models.
All three fields are best-effort: parsing is format-only and consults
no postal reference. Inputs that don’t follow the
(unit, house_number, street) shape degrade gracefully, with the
missing pieces returned as None.
Fields§
§house_number: Option<String>Leading house / building number, including an optional single
alphabetic suffix ("10A"), uppercased. None when no leading
digit is present.
unit: Option<String>Sub-unit prefix and identifier, lowercased and space-joined
(e.g. "flat 2a", "apt 5", "suite 12"). None when no
recognised prefix is present.
street: StringRemaining street portion, normalised via
Normalizer::normalize_address_line.
Trait Implementations§
Source§impl Clone for ParsedAddressLine
impl Clone for ParsedAddressLine
Source§fn clone(&self) -> ParsedAddressLine
fn clone(&self) -> ParsedAddressLine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParsedAddressLine
impl Debug for ParsedAddressLine
Source§impl<'de> Deserialize<'de> for ParsedAddressLine
impl<'de> Deserialize<'de> for ParsedAddressLine
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 PartialEq for ParsedAddressLine
impl PartialEq for ParsedAddressLine
Source§fn eq(&self, other: &ParsedAddressLine) -> bool
fn eq(&self, other: &ParsedAddressLine) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ParsedAddressLine
impl Serialize for ParsedAddressLine
impl Eq for ParsedAddressLine
impl StructuralPartialEq for ParsedAddressLine
Auto Trait Implementations§
impl Freeze for ParsedAddressLine
impl RefUnwindSafe for ParsedAddressLine
impl Send for ParsedAddressLine
impl Sync for ParsedAddressLine
impl Unpin for ParsedAddressLine
impl UnsafeUnpin for ParsedAddressLine
impl UnwindSafe for ParsedAddressLine
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> 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