Struct udev::MonitorBuilder
[−]
[src]
pub struct MonitorBuilder { /* fields omitted */ }
Monitors for device events.
A monitor communicates with the kernel over a socket. Filtering events is performed efficiently in the kernel, and only events that match the filters are received by the socket. Filters must be setup before listening for events.
Methods
impl MonitorBuilder
[src]
fn new(context: &Context) -> Result<Self>
[src]
Creates a new Monitor
.
fn match_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>
[src]
Adds a filter that matches events for devices with the given subsystem.
fn match_subsystem_devtype<T: AsRef<OsStr>, U: AsRef<OsStr>>(
&mut self,
subsystem: T,
devtype: U
) -> Result<()>
[src]
&mut self,
subsystem: T,
devtype: U
) -> Result<()>
Adds a filter that matches events for devices with the given subsystem and device type.
fn match_tag<T: AsRef<OsStr>>(&mut self, tag: T) -> Result<()>
[src]
Adds a filter that matches events for devices with the given tag.
fn clear_filters(&mut self) -> Result<()>
[src]
Removes all filters currently set on the monitor.
fn listen(self) -> Result<MonitorSocket>
[src]
Listens for events matching the current filters.
This method consumes the Monitor
.
Trait Implementations
impl Drop for MonitorBuilder
[src]
impl AsRaw<udev_monitor> for MonitorBuilder
[src]
fn as_raw(&self) -> *mut udev_monitor
[src]
Get a reference of the underlying struct. Read more
fn into_raw(self) -> *mut udev_monitor
[src]
Convert the object into the underlying pointer. Read more
impl FromRawWithContext<udev_monitor> for MonitorBuilder
[src]
unsafe fn from_raw(context: &Context, ptr: *mut udev_monitor) -> MonitorBuilder
[src]
Create an object from a given raw pointer and the matching context. Read more