gibsonpil / libpci-rs

A cross-platform PCI enumeration library for Rust.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

libpci-rs 0.2.10-testing

⚠ UNDER CONSTRUCTION ⚠

Crates.io GitHub GitHub Workflow Status (with event)

Unstable work-in-progress cross-platform library to detect and list PCI devices and their information.

This library does not bind to or require libpci. As much of the library as possible is written in Rust as a general rule. Unfortunately, not all operating systems have stable or maintained Rust APIs, so code for those will be split off into a C++17 backend.

This project uses Semantic Versioning.

Building

Building libpci-rs easy. Below is an example of how you might go about it.

Build Dependencies

Aside from the dependencies pulled in by Cargo, libpci-rs requires a few packages be installed on your system, some are required and some are only needed if you are trying to do certain things. Notes will be added in for those that aren't always needed.

Documentation

Documentation is included in the code itself, in the form of Rustdoc comments. It includes the following useful pieces of information:

To view the docs, clone the repo and enter the directory, before running cargo doc --open.

Platform Support

Platform OS API Backend Language
Windows setupapi Rust backend
Linux/Android sysfs Rust backend
macOS/Darwin IOKit C++ backend
FreeBSD /dev/pci C++ backend
DragonflyBSD /dev/pci C++ backend
OpenBSD /dev/pci C++ backend
NetBSD /dev/pci C++ backend
Haiku /dev/misc/poke C++ backend