Struct udev::MonitorBuilder [−][src]
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
impl Builder
[src]
pub fn new() -> Result<Self>
[src]
Creates a new Monitor
.
pub fn match_subsystem<T: AsRef<OsStr>>(self, subsystem: T) -> Result<Self>
[src]
Adds a filter that matches events for devices with the given subsystem.
pub fn match_subsystem_devtype<T: AsRef<OsStr>, U: AsRef<OsStr>>(
self,
subsystem: T,
devtype: U
) -> Result<Self>
[src]
self,
subsystem: T,
devtype: U
) -> Result<Self>
Adds a filter that matches events for devices with the given subsystem and device type.
pub fn match_tag<T: AsRef<OsStr>>(self, tag: T) -> Result<Self>
[src]
Adds a filter that matches events for devices with the given tag.
pub fn clear_filters(self) -> Result<Self>
[src]
Removes all filters currently set on the monitor.
pub fn listen(self) -> Result<Socket>
[src]
Listens for events matching the current filters.
This method consumes the Monitor
.
Trait Implementations
impl AsRawWithContext<udev_monitor> for Builder
[src]
fn as_raw(&self) -> *mut udev_monitor
[src]
fn udev(&self) -> &Udev
[src]
fn into_raw_with_context(self) -> (*mut udev, *mut udev_monitor)
[src]
impl Clone for Builder
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for Builder
[src]
impl FromRawWithContext<udev_monitor> for Builder
[src]
unsafe fn from_raw_with_context(udev: *mut udev, t: *mut udev_monitor) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl !Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,