12 releases (6 breaking)

0.7.2 Feb 5, 2024
0.7.1 Oct 27, 2023
0.6.3 Sep 21, 2023
0.6.2 Nov 13, 2022
0.1.0 Dec 10, 2021

#208 in Database interfaces

Download history 423/week @ 2023-12-18 396/week @ 2023-12-25 375/week @ 2024-01-01 405/week @ 2024-01-08 871/week @ 2024-01-15 1211/week @ 2024-01-22 599/week @ 2024-01-29 642/week @ 2024-02-05 469/week @ 2024-02-12 734/week @ 2024-02-19 1477/week @ 2024-02-26 1490/week @ 2024-03-04 970/week @ 2024-03-11 740/week @ 2024-03-18 616/week @ 2024-03-25 855/week @ 2024-04-01

3,318 downloads per month
Used in 9 crates (3 directly)

MIT license

330KB
583 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("1002").unwrap();
assert_eq!(vendor.name, "Advanced Micro Devices, Inc. [AMD/ATI]");
// Get device
let device = vendor.devices.get("67df").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("1002", "67DF", "1DA2", "E387");

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

You can also fetch the online DB:

use pciid_parser::Database;

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

Dependencies