13 releases (7 breaking)

0.8.0 Feb 1, 2025
0.7.2 Feb 5, 2024
0.7.1 Oct 27, 2023
0.6.2 Nov 13, 2022
0.1.0 Dec 10, 2021

#1809 in Database interfaces

Download history 3763/week @ 2025-10-06 3516/week @ 2025-10-13 3031/week @ 2025-10-20 3481/week @ 2025-10-27 3090/week @ 2025-11-03 2687/week @ 2025-11-10 2895/week @ 2025-11-17 3000/week @ 2025-11-24 2737/week @ 2025-12-01 2779/week @ 2025-12-08 3842/week @ 2025-12-15 2499/week @ 2025-12-22 2537/week @ 2025-12-29 4415/week @ 2026-01-05 4916/week @ 2026-01-12 4960/week @ 2026-01-19

17,196 downloads per month
Used in 16 crates (3 directly)

MIT license

330KB
599 lines

PCI ID Parser

Crates.io Docs.rs

This is a library that lets you use a PCI ID database, such as one shipped with Linux distros or from https://pci-ids.ucw.cz/. It can either read the locally installed file or fetch one from the website.

Usage

Read the local DB:

use pciid_parser::Database;

let db = Database::read().unwrap();

// Get vendor
let vendor = db.vendors.get(&0x1002).unwrap();
assert_eq!(vendor.name, "Advanced Micro Devices, Inc. [AMD/ATI]");
// Get device
let device = vendor.devices.get(&0x67df).unwrap();
assert_eq!(
  device.name,
  "Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]"
);  

// Get full device and subdevice info:
let info = db.get_device_info(0x1002, 0x67df, 0x1DA2, 0xE387);

// Get class
let class = db.classes.get(&0x05).unwrap();
assert_eq!(class.name, "Memory controller");

You can also fetch the online DB:

use pciid_parser::Database;

let db = Database::get_online().unwrap();

Breaking changes

  • 0.8.0: version vendor and device ids are now stored as integers instead of strings

Dependencies

~0–11MB
~91K SLoC