#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PciDeviceAddressStringParseError
{
#[allow(missing_docs)]
LengthIsWrong
{
length: usize
},
#[allow(missing_docs)]
NoDomain,
#[allow(missing_docs)]
CouldNotParseDomain
{
value: Vec<u8>,
cause: ParseNumberError,
},
#[allow(missing_docs)]
NoBus,
#[allow(missing_docs)]
CouldNotParseBus
{
value: Vec<u8>,
cause: ParseNumberError,
},
#[allow(missing_docs)]
NoDeviceIdentifier,
CouldNotParseDeviceIdentifier
{
value: Vec<u8>,
cause: ParseNumberError,
},
DeviceNumberExceeds5BitValue
{
value: u8,
},
#[allow(missing_docs)]
NoFunction,
#[allow(missing_docs)]
CouldNotParseFunction
{
value: Vec<u8>,
cause: ParseNumberError,
},
FunctionExceeds4BitValue
{
value: u8,
},
}
impl Display for PciDeviceAddressStringParseError
{
#[inline(always)]
fn fmt(&self, f: &mut Formatter) -> fmt::Result
{
<PciDeviceAddressStringParseError as Debug>::fmt(self, f)
}
}
impl error::Error for PciDeviceAddressStringParseError
{
#[inline(always)]
fn source(&self) -> Option<&(dyn error::Error + 'static)>
{
use self::PciDeviceAddressStringParseError::*;
match self
{
&LengthIsWrong { .. } => None,
&NoDomain => None,
&CouldNotParseDomain { ref cause, .. } => Some(cause),
&NoBus => None,
&CouldNotParseBus { ref cause, .. } => Some(cause),
&NoDeviceIdentifier => None,
&CouldNotParseDeviceIdentifier { ref cause, .. } => Some(cause),
&DeviceNumberExceeds5BitValue { .. } => None,
&NoFunction => None,
&CouldNotParseFunction { ref cause, .. } => Some(cause),
&FunctionExceeds4BitValue { .. } => None,
}
}
}