pub struct MonitorBuilder { /* private fields */ }Expand description
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.
Implementations§
Source§impl MonitorBuilder
impl MonitorBuilder
Sourcepub fn match_subsystem<T>(self, subsystem: T) -> Result<Self>
pub fn match_subsystem<T>(self, subsystem: T) -> Result<Self>
Adds a filter that matches events for devices with the given subsystem.
Sourcepub fn match_subsystem_devtype<T, U>(
self,
subsystem: T,
devtype: U,
) -> Result<Self>
pub fn match_subsystem_devtype<T, U>( self, subsystem: T, devtype: U, ) -> Result<Self>
Adds a filter that matches events for devices with the given subsystem and device type.
Sourcepub fn match_tag<T>(self, tag: T) -> Result<Self>
pub fn match_tag<T>(self, tag: T) -> Result<Self>
Adds a filter that matches events for devices with the given tag.
Sourcepub fn clear_filters(self) -> Result<Self>
pub fn clear_filters(self) -> Result<Self>
Removes all filters currently set on the monitor.
Sourcepub fn listen(self) -> Result<MonitorSocket>
pub fn listen(self) -> Result<MonitorSocket>
Listens for events matching the current filters.
This method consumes the MonitorBuilder.
Auto Trait Implementations§
impl Freeze for MonitorBuilder
impl RefUnwindSafe for MonitorBuilder
impl !Send for MonitorBuilder
impl !Sync for MonitorBuilder
impl Unpin for MonitorBuilder
impl UnwindSafe for MonitorBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more