pub enum Error {
InvalidLength,
InvalidCharset,
UnknownString,
UnknownCode,
}Expand description
An enumeration of errors which can be returned while deriving a country code from a string or integer.
Variants§
InvalidLength
The string provided is too long to be a country code
InvalidCharset
The string provided is not a valid ASCII string
UnknownString
The string provided is not a valid country code string
UnknownCode
The number provided is not a valid country code
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_invalid_length(&self) -> bool
pub const fn is_invalid_length(&self) -> bool
The enum variant is InvalidLength
Sourcepub const fn is_invalid_charset(&self) -> bool
pub const fn is_invalid_charset(&self) -> bool
The enum variant is InvalidCharset
Sourcepub const fn is_unknown_string(&self) -> bool
pub const fn is_unknown_string(&self) -> bool
The enum variant is UnknownString
Sourcepub const fn is_unknown_code(&self) -> bool
pub const fn is_unknown_code(&self) -> bool
The enum variant is UnknownCode
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Error
impl Ord for Error
Source§impl PartialOrd for Error
impl PartialOrd for Error
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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