Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Udev bindings for rust
These bindings effectivly map one-to-one to libudev (but calling them is much simpler/nicer than C).
!!!WARNING!!!
This is alpha quality and my first rust project. Please comment/review my code (I'm probably doing quite a few things wrong).
Implementation Notes
Threading
One caviat to note is that this library is not thread safe (you can't share data structures between threads). Unfortunately, this means a udev context and all udev objects created from it will have to stay within the same thread.
Monitors
I currently don't expose the underlying monitor file descriptor and don't provide a way to asynchronously wait on a monitor. While I would like this feature, I can't see a safe way to provide it at the moment.
Enumerators
The enumerators API is a little funky because it matches the underlying libudev
API as much as possible. Specifically, you have to remember to call
scan_devices
, scan_subsystems
, or at least add_device
before iterating to
actually do anything useful. At first, I included an implicit device scan in
the iter function but this isn't quite as powerful. As is, you iterativly build
up a list of devices in an enumerator (by repeatedly calling match_*
and then
scan_*
).
In the future, I might consider adding a simpler (saner) query interface.
Iterator Proliferation
You might notice the plethera of iterators that basically just map/filter the private UdevIterator. I used to use map/filter but then I ended up exposing implementation details in return types. If there is a better way to do this (that rust currently supports...), please tell me.
Examples
List TTY device nodes
let udev = new;
for dev in udev.enumerator.match_subsystem.scan_devices.iter
Monitor for added/removed block devices
let udev = new;
for in udev.monitor.unwrap.filter_by_subsystem.iter