Struct AddressCountryCode
pub struct AddressCountryCode(/* private fields */);Implementations§
§impl AddressCountryCode
impl AddressCountryCode
pub fn new(
value: impl AsRef<str>,
) -> Result<AddressCountryCode, AddressCountryCodeError>
pub fn new( value: impl AsRef<str>, ) -> Result<AddressCountryCode, 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§
§impl AsRef<str> for AddressCountryCode
impl AsRef<str> for AddressCountryCode
§impl Clone for AddressCountryCode
impl Clone for AddressCountryCode
§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 more§impl Debug for AddressCountryCode
impl Debug for AddressCountryCode
§impl Display for AddressCountryCode
impl Display for AddressCountryCode
§impl FromStr for AddressCountryCode
impl FromStr for AddressCountryCode
§type Err = AddressCountryCodeError
type Err = AddressCountryCodeError
The associated error which can be returned from parsing.
§fn from_str(
value: &str,
) -> Result<AddressCountryCode, <AddressCountryCode as FromStr>::Err>
fn from_str( value: &str, ) -> Result<AddressCountryCode, <AddressCountryCode as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for AddressCountryCode
impl Hash for AddressCountryCode
§impl Ord for AddressCountryCode
impl Ord for AddressCountryCode
§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
§impl PartialEq for AddressCountryCode
impl PartialEq for AddressCountryCode
§impl PartialOrd for AddressCountryCode
impl PartialOrd for AddressCountryCode
§impl TryFrom<&str> for AddressCountryCode
impl TryFrom<&str> for AddressCountryCode
§type Error = AddressCountryCodeError
type Error = AddressCountryCodeError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<AddressCountryCode, <AddressCountryCode as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<AddressCountryCode, <AddressCountryCode as TryFrom<&str>>::Error>
Performs the conversion.
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