Struct udev::Udev
[-]
[+]
[src]
pub struct Udev { // some fields omitted }
Methods
impl Udev
fn new() -> Udev
Create a new udev handle.
fn monitor(&self) -> Result<Monitor, IoError>
Monitor udev events.
Error
This will return an error if you're running in an environment without access to netlink.
unsafe fn monitor_kernel(&self) -> Result<Monitor, IoError>
Monitor kernel events.
Error
This method will return an error if you're running in an environment without access to netlink.
Safety Notes
This method is marked unsafe due to the following warning found in libudev:
Applications should usually not connect directly to the "kernel" events, because the devices might not be useable at that time, before udev has configured them, and created device nodes. Accessing devices at the same time as udev, might result in unpredictable behavior. The "udev" events are sent out after udev has finished its event processing, all rules have been processed, and needed device nodes are created.
fn hwdb(&self) -> Result<Hwdb, i32>
Create a new hardware database handle.
Error
On error, this method will return either Err(errno) or Err(0). Err(errno) indicates a problem reading the hardware database and Err(0) indicates that the hardware database is corrupt.
fn device(&self, path: &Path) -> Option<Device>
Lookup a device by sys path.
fn device_from_devnum(&self, ty: Type, devnum: Devnum) -> Option<Device>
Lookup a device by device type and device number.
fn device_from_subsystem_sysname(&self, subsystem: &str, sysname: &str) -> Option<Device>
Lookup a device by subsystem and sysname
fn enumerator(&self) -> Enumerator
Create a device enumerator.