pub struct PostalCode(/* private fields */);Implementations§
Source§impl PostalCode
impl PostalCode
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, PostalCodeError>
pub fn new(value: impl AsRef<str>) -> Result<Self, PostalCodeError>
Creates a postal code from non-empty ASCII-safe text.
§Errors
Returns PostalCodeError::Empty when the trimmed value is empty.
Returns PostalCodeError::InvalidCharacter when the value contains
non-ASCII or control characters.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl AsRef<str> for PostalCode
impl AsRef<str> for PostalCode
Source§impl Clone for PostalCode
impl Clone for PostalCode
Source§fn clone(&self) -> PostalCode
fn clone(&self) -> PostalCode
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 PostalCode
impl Debug for PostalCode
Source§impl Display for PostalCode
impl Display for PostalCode
Source§impl FromStr for PostalCode
impl FromStr for PostalCode
Source§impl Hash for PostalCode
impl Hash for PostalCode
Source§impl Ord for PostalCode
impl Ord for PostalCode
Source§fn cmp(&self, other: &PostalCode) -> Ordering
fn cmp(&self, other: &PostalCode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PostalCode
impl PartialEq for PostalCode
Source§fn eq(&self, other: &PostalCode) -> bool
fn eq(&self, other: &PostalCode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PostalCode
impl PartialOrd for PostalCode
Source§impl TryFrom<&str> for PostalCode
impl TryFrom<&str> for PostalCode
impl Eq for PostalCode
impl StructuralPartialEq for PostalCode
Auto Trait Implementations§
impl Freeze for PostalCode
impl RefUnwindSafe for PostalCode
impl Send for PostalCode
impl Sync for PostalCode
impl Unpin for PostalCode
impl UnsafeUnpin for PostalCode
impl UnwindSafe for PostalCode
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