1use core::fmt;
2
3#[derive(Copy, Debug, PartialEq, Eq, Clone)]
5pub enum ParseMacAddrError {
6 TooManyComponents,
8 TooFewComponents,
10 InvalidComponent,
12}
13
14impl fmt::Display for ParseMacAddrError {
15 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
16 let s = match *self {
17 ParseMacAddrError::TooManyComponents => "Too many components in a MAC address string",
18 ParseMacAddrError::TooFewComponents => "Too few components in a MAC address string",
19 ParseMacAddrError::InvalidComponent => "Invalid component in a MAC address string",
20 };
21 f.write_str(s)
22 }
23}
24
25#[cfg(feature = "std")]
26impl std::error::Error for ParseMacAddrError {}