[][src]Struct libudev::Monitor

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]

pub fn new(context: &'a Context) -> Result<Self>[src]

Creates a new Monitor.

pub fn match_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>[src]

Adds a filter that matches events for devices with the given subsystem.

pub fn match_subsystem_devtype<T: AsRef<OsStr>, U: AsRef<OsStr>>(
    &mut self,
    subsystem: T,
    devtype: U
) -> Result<()>
[src]

Adds a filter that matches events for devices with the given subsystem and device type.

pub fn match_tag<T: AsRef<OsStr>>(&mut self, tag: T) -> Result<()>[src]

Adds a filter that matches events for devices with the given tag.

pub fn clear_filters(&mut self) -> Result<()>[src]

Removes all filters currently set on the monitor.

pub fn listen(self) -> Result<MonitorSocket<'a>>[src]

Listens for events matching the current filters.

This method consumes the Monitor.

Trait Implementations

impl<'a> Drop for Monitor<'a>[src]

Auto Trait Implementations

impl<'a> !Send for Monitor<'a>

impl<'a> !Sync for Monitor<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]