#udev #linux #unix #linux-api #public-api #devfs

udevrs

Pure Rust implementation of the user-land udev library

4 releases (2 breaking)

0.3.0 Jun 24, 2024
0.2.0 May 22, 2024
0.1.1 Dec 6, 2023
0.1.0 Dec 6, 2023

#415 in Unix APIs

Download history 82/week @ 2024-06-26 79/week @ 2024-07-03 101/week @ 2024-07-10 20/week @ 2024-07-17 41/week @ 2024-07-24 20/week @ 2024-07-31 53/week @ 2024-08-07 41/week @ 2024-08-14 42/week @ 2024-08-21 35/week @ 2024-08-28 28/week @ 2024-09-04 133/week @ 2024-09-11 90/week @ 2024-09-18 109/week @ 2024-09-25 74/week @ 2024-10-02 189/week @ 2024-10-09

481 downloads per month
Used in cyme

LGPL-2.0-or-later

2.5MB
5.5K SLoC

udev

Rust port of the eudev project for interacting with the Linux devfs filesystem.

The project attempts to maintain a public API as close to possible with the original C project.

This library is an init-system independent implementation, just like eudev.

Safety

As much as possible, code is written in safe Rust. Some points of interaction with the Linux API require unsafe code.

All unsafe code is wrapped in safe interfaces, and documented with SAFETY comments.

There are no C dependencies.

Rust API

All Rust structs have a public API that is somewhat close to counterparts in the eudev library.

See library documentation for usage.

To generate documentation locally:

$ cd udev
$ cargo doc --all --open

As the project matures, use-case examples will be added to doc-tests.

WIP

Currently, there is only a Rust public API. Work is still ongoing to expose remaining subsystems via the top-level API:

  • public C API via FFI
    • after the Rust API stabilizes, work can start on a C API
    • some abstractions will take some work to expose safely through the FFI barrier, e.g. Arc<Udev>

Dependencies