#[derive(Debug)]
pub enum DriverProfileError
{
FindDriverProfile(FindDriverProfileError),
FailedToRetrieveAllPciBuses(io::Error),
AtLeastTwoHyperThreadsAreRequired
{
network_interface_name: NetworkInterfaceName,
actual_number: usize,
},
CouldNotGetNumberOfChannels
{
network_interface_name: NetworkInterfaceName,
error: NetworkDeviceInputOutputControlError<Infallible>,
},
DoesNotSupportNumberOfChannels
{
network_interface_name: NetworkInterfaceName,
},
DoesNotSupportCombinedChannels
{
network_interface_name: NetworkInterfaceName,
},
CouldNotGetNumberOfReceiveRingQueues
{
network_interface_name: NetworkInterfaceName,
error: NetworkDeviceInputOutputControlError<ParseNumberError>,
},
CouldNotGetReceiveSideScalingHashFunctionConfiguration
{
network_interface_name: NetworkInterfaceName,
error: NetworkDeviceInputOutputControlError<HashFunctionNameUnsupportedError>,
},
IndirectionTableLength(IndirectionTableLengthError),
DoesNotSupportAHashFunctionIndirectionTable,
DoesNotSupportAHashFunctionSeed,
ConfigureDriverProfile(ConfigureDriverProfileError),
}
impl Display for DriverProfileError
{
#[inline(always)]
fn fmt(&self, f: &mut Formatter) -> fmt::Result
{
Debug::fmt(self, f)
}
}
impl error::Error for DriverProfileError
{
#[inline(always)]
fn source(&self) -> Option<&(dyn Error + 'static)>
{
match self
{
&FindDriverProfile(ref error) => Some(error),
&FailedToRetrieveAllPciBuses(ref error) => Some(error),
&AtLeastTwoHyperThreadsAreRequired { .. } => None,
&CouldNotGetNumberOfChannels { ref error, ..} => Some(error),
&DoesNotSupportNumberOfChannels { .. } => None,
&DoesNotSupportCombinedChannels { .. } => None,
&CouldNotGetNumberOfReceiveRingQueues { .. } => None,
&CouldNotGetReceiveSideScalingHashFunctionConfiguration { ref error, .. } => Some(error),
&IndirectionTableLength(ref error) => Some(error),
&DoesNotSupportAHashFunctionIndirectionTable => None,
&DoesNotSupportAHashFunctionSeed => None,
&ConfigureDriverProfile(ref error) => Some(error),
}
}
}
impl From<FindDriverProfileError> for DriverProfileError
{
#[inline(always)]
fn from(value: FindDriverProfileError) -> Self
{
FindDriverProfile(value)
}
}
impl From<IndirectionTableLengthError> for DriverProfileError
{
#[inline(always)]
fn from(value: IndirectionTableLengthError) -> Self
{
IndirectionTableLength(value)
}
}
impl From<ConfigureDriverProfileError> for DriverProfileError
{
#[inline(always)]
fn from(value: ConfigureDriverProfileError) -> Self
{
ConfigureDriverProfile(value)
}
}