pub enum ParseError<const N: usize> {
InvalidLength(usize),
UnexpectedSeparator {
expected: u8,
actual: u8,
},
InvalidSeparator(u8),
InvalidHexDigit([u8; 2]),
}Expand description
ParseError represents an error that occurred while parsing hex address.
Variants§
InvalidLength(usize)
Returned when the input string has a invalid length.
UnexpectedSeparator
Returned when the input string has an invalid seperator.
InvalidSeparator(u8)
Returned when the input string has an unexpected separator.
InvalidHexDigit([u8; 2])
Invalid digit.
Implementations§
Source§impl<const N: usize> ParseError<N>
impl<const N: usize> ParseError<N>
Sourcepub const fn invalid_length(len: usize) -> Self
pub const fn invalid_length(len: usize) -> Self
Returns the length of the address.
Sourcepub const fn unexpected_separator(expected: u8, actual: u8) -> Self
pub const fn unexpected_separator(expected: u8, actual: u8) -> Self
Returns an error for an unexpected separator.
Sourcepub const fn invalid_separator(sep: u8) -> Self
pub const fn invalid_separator(sep: u8) -> Self
Returns an error for an invalid separator.
Sourcepub const fn invalid_hex_digit(digit: [u8; 2]) -> Self
pub const fn invalid_hex_digit(digit: [u8; 2]) -> Self
Returns an error for an invalid hex digit.
Trait Implementations§
Source§impl<const N: usize> Clone for ParseError<N>
impl<const N: usize> Clone for ParseError<N>
Source§fn clone(&self) -> ParseError<N>
fn clone(&self) -> ParseError<N>
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<const N: usize> Debug for ParseError<N>
impl<const N: usize> Debug for ParseError<N>
Source§impl<const N: usize> Display for ParseError<N>
impl<const N: usize> Display for ParseError<N>
Source§impl<const N: usize> Error for ParseError<N>
impl<const N: usize> Error for ParseError<N>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<const N: usize> PartialEq for ParseError<N>
impl<const N: usize> PartialEq for ParseError<N>
impl<const N: usize> Eq for ParseError<N>
impl<const N: usize> StructuralPartialEq for ParseError<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for ParseError<N>
impl<const N: usize> RefUnwindSafe for ParseError<N>
impl<const N: usize> Send for ParseError<N>
impl<const N: usize> Sync for ParseError<N>
impl<const N: usize> Unpin for ParseError<N>
impl<const N: usize> UnwindSafe for ParseError<N>
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