Struct libudev::Monitor
[−]
[src]
pub struct Monitor<'a> { /* 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<'a> Monitor<'a>
[src]
fn new(context: &'a Context) -> Result<Self>
Creates a new Monitor
.
fn match_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>
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<()>
&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<()>
Adds a filter that matches events for devices with the given tag.
fn clear_filters(&mut self) -> Result<()>
Removes all filters currently set on the monitor.
fn listen(self) -> Result<MonitorSocket<'a>>
Listens for events matching the current filters.
This method consumes the Monitor
.