#cross-platform #information #connected #retrieving #system-info #hardware #description

devices

A cross-platform library for retrieving information about connected devices

9 releases (5 breaking)

0.5.0 Sep 5, 2023
0.4.0 Sep 5, 2023
0.3.0 Feb 27, 2023
0.2.3 Dec 24, 2022
0.0.0 Dec 17, 2022

#757 in Hardware support

Download history 8/week @ 2024-03-11 44/week @ 2024-04-01 4/week @ 2024-04-29 12/week @ 2024-05-27 5/week @ 2024-06-03 26/week @ 2024-06-10 5/week @ 2024-06-17 24/week @ 2024-06-24

61 downloads per month

MIT/Apache

27KB
635 lines

Devices

devices is a cross-platform library for retrieving information about connected devices.

Combined with a library like sysinfo, a more or less complete description of a system's hardware can be gathered.

Supported platforms

  • Linux (lspci and lsusb required)
  • Windows (Windows 7+ / Wine not supported)

Implementation Notes

Wine provides the APIs this library needs to function, but it does not return all the information necessary to build the DeviceInfo struct. When running on Wine, all device-retrieving methods will return Error::UnsupportedPlatform.

On Linux, this library works by creating a subprocess to gather device information and parsing the result. Pulling device information from a platform-specific API would be preferred. PRs welcome.

Cargo Features

  • bincode: Support for bincode v2 encoding and decoding. Enabled by default.
  • serde: Support for serde serialization and deserialization. Enabled by default.

License

devices is dual-licensed under MIT and Apache-2.0.

Dependencies

~3.5–5MB
~93K SLoC