pub struct PostalAddress { /* private fields */ }Expand description
Postal address primitive for structured-data records.
Implementations§
Source§impl PostalAddress
impl PostalAddress
Sourcepub fn new(
street_address: impl AsRef<str>,
address_locality: impl AsRef<str>,
address_region: impl AsRef<str>,
postal_code: impl AsRef<str>,
address_country: impl AsRef<str>,
) -> Result<Self, SchemaValueError>
pub fn new( street_address: impl AsRef<str>, address_locality: impl AsRef<str>, address_region: impl AsRef<str>, postal_code: impl AsRef<str>, address_country: impl AsRef<str>, ) -> Result<Self, SchemaValueError>
Creates a postal address record.
§Errors
Returns SchemaValueError::Empty when any address component is empty.
Sourcepub const fn schema_type(&self) -> &'static str
pub const fn schema_type(&self) -> &'static str
Returns the schema-like type label.
Sourcepub fn street_address(&self) -> &str
pub fn street_address(&self) -> &str
Returns the street address.
Trait Implementations§
Source§impl Clone for PostalAddress
impl Clone for PostalAddress
Source§fn clone(&self) -> PostalAddress
fn clone(&self) -> PostalAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PostalAddress
impl Debug for PostalAddress
Source§impl PartialEq for PostalAddress
impl PartialEq for PostalAddress
Source§fn eq(&self, other: &PostalAddress) -> bool
fn eq(&self, other: &PostalAddress) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PostalAddress
impl StructuralPartialEq for PostalAddress
Auto Trait Implementations§
impl Freeze for PostalAddress
impl RefUnwindSafe for PostalAddress
impl Send for PostalAddress
impl Sync for PostalAddress
impl Unpin for PostalAddress
impl UnsafeUnpin for PostalAddress
impl UnwindSafe for PostalAddress
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
Mutably borrows from an owned value. Read more