Struct tokio_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]
impl MonitorBuilder
pub fn new(context: &Context) -> Result<Self>
[src]
pub fn new(context: &Context) -> Result<Self>
Creates a new MonitorSocket
.
pub fn match_subsystem<T>(&mut self, subsystem: T) -> Result<()> where
T: AsRef<OsStr>,
[src]
pub fn match_subsystem<T>(&mut self, subsystem: T) -> Result<()> where
T: AsRef<OsStr>,
Adds a filter that matches events for devices with the given subsystem.
pub fn match_subsystem_devtype<T, U>(
&mut self,
subsystem: T,
devtype: U
) -> Result<()> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
[src]
pub fn match_subsystem_devtype<T, U>(
&mut self,
subsystem: T,
devtype: U
) -> Result<()> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
Adds a filter that matches events for devices with the given subsystem and device type.
pub fn match_tag<T>(&mut self, tag: T) -> Result<()> where
T: AsRef<OsStr>,
[src]
pub fn match_tag<T>(&mut self, tag: T) -> Result<()> where
T: AsRef<OsStr>,
Adds a filter that matches events for devices with the given tag.
pub fn clear_filters(&mut self) -> Result<()>
[src]
pub fn clear_filters(&mut self) -> Result<()>
Removes all filters currently set on the monitor.
pub fn listen(self) -> Result<MonitorSocket>
[src]
pub fn listen(self) -> Result<MonitorSocket>
Listens for events matching the current filters.
This method consumes the MonitorBuilder
.
Auto Trait Implementations
impl !Send for MonitorBuilder
impl !Send for MonitorBuilder
impl !Sync for MonitorBuilder
impl !Sync for MonitorBuilder