1mod pci_info_enumeration_error;
2mod pci_info_error;
3mod pci_info_error_string;
4
5use std::{error::Error, fmt::Display};
6
7pub use pci_info_enumeration_error::{
8 PciDeviceEnumerationError, PciDeviceEnumerationErrorImpact, PciDeviceEnumerationErrorLocation,
9};
10pub use pci_info_error::PciInfoError;
11pub use pci_info_error_string::PciInfoErrorString;
12
13#[derive(Debug)]
15pub enum PciInfoPropertyError {
16 Unsupported,
18 Error(Box<PciInfoError>),
21}
22
23impl Display for PciInfoPropertyError {
24 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25 match self {
26 Self::Unsupported => write!(f, "unsupported by current enumerator"),
27 Self::Error(e) => write!(f, "{e}"),
28 }
29 }
30}
31
32impl Error for PciInfoPropertyError {
33 fn source(&self) -> Option<&(dyn Error + 'static)> {
34 match self {
35 Self::Unsupported => None,
36 Self::Error(e) => Some(e),
37 }
38 }
39}