```rust use pcifetch::classes::DeviceClass; use pcifetch::linux::; use pci_fetch::traits::; use std::path::PathBuf;
fn main() { // Instantiate a new PCIDevice so we can get to know it a bit. let mut device: PCIDevice = PCIDevice::new(PathBuf::from("/sys/bus/pci/devices/0000:00:02.0")); // This little guy is important :) device.init();
println!("Path: {:?}", device.path()); // e.g. /sys/bus/pci/devices/0000:00:02.0
println!("Address: {}", device.address()); // e.g. 00:02.0
println!("Class ID: {}", device.class_id()); // e.g. 03
println!("Class ID: {}", device.class_name()); // e.g. Display Controller
// Alternatively, we can get information on PCI devices through fetching them in bulk!
// Returns a list of the available display controllers.
let list: Vec<PCIDevice> = fetch_by_class(DeviceClass::DisplayController);
println!("{:?}", list);
}
```
| Platform | Support | | :-------: | :-----: | | Linux | ✓ |