pub struct AddressCountryCode(/* private fields */);Implementations§
Source§impl AddressCountryCode
impl AddressCountryCode
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, AddressCountryCodeError>
pub fn new(value: impl AsRef<str>) -> Result<Self, AddressCountryCodeError>
Creates an uppercase alpha-2 address country code.
§Errors
Returns AddressCountryCodeError::Empty when the trimmed value is
empty.
Returns AddressCountryCodeError::InvalidLength when the value does
not contain exactly two characters.
Returns AddressCountryCodeError::InvalidCharacter when the value
contains non-ASCII alphabetic characters.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl AsRef<str> for AddressCountryCode
impl AsRef<str> for AddressCountryCode
Source§impl Clone for AddressCountryCode
impl Clone for AddressCountryCode
Source§fn clone(&self) -> AddressCountryCode
fn clone(&self) -> AddressCountryCode
Returns a duplicate of the value. Read more
1.0.0 · 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 AddressCountryCode
impl Debug for AddressCountryCode
Source§impl Display for AddressCountryCode
impl Display for AddressCountryCode
Source§impl FromStr for AddressCountryCode
impl FromStr for AddressCountryCode
Source§impl Hash for AddressCountryCode
impl Hash for AddressCountryCode
Source§impl Ord for AddressCountryCode
impl Ord for AddressCountryCode
Source§fn cmp(&self, other: &AddressCountryCode) -> Ordering
fn cmp(&self, other: &AddressCountryCode) -> Ordering
1.21.0 · 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 AddressCountryCode
impl PartialEq for AddressCountryCode
Source§impl PartialOrd for AddressCountryCode
impl PartialOrd for AddressCountryCode
Source§impl TryFrom<&str> for AddressCountryCode
impl TryFrom<&str> for AddressCountryCode
impl Eq for AddressCountryCode
impl StructuralPartialEq for AddressCountryCode
Auto Trait Implementations§
impl Freeze for AddressCountryCode
impl RefUnwindSafe for AddressCountryCode
impl Send for AddressCountryCode
impl Sync for AddressCountryCode
impl Unpin for AddressCountryCode
impl UnsafeUnpin for AddressCountryCode
impl UnwindSafe for AddressCountryCode
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