[−][src]Struct mio_udev::Enumerator
An enumeration context.
An Enumerator scans /sys
for devices matching its filters. Filters are added to an Enumerator
by calling its match_*
and nomatch_*
methods. After the filters are setup, the
scan_devices()
method finds devices in /sys
that match the filters.
Implementations
impl Enumerator
[src]
pub fn new() -> Result<Enumerator, Error>
[src]
Creates a new Enumerator.
pub fn with_udev(udev: Udev) -> Result<Enumerator, Error>
[src]
Creates a new Enumerator
with an existing Udev
instance
pub fn match_is_initialized(&mut self) -> Result<(), Error>
[src]
Adds a filter that matches only initialized devices.
pub fn match_subsystem<T>(&mut self, subsystem: T) -> Result<(), Error> where
T: AsRef<OsStr>,
[src]
T: AsRef<OsStr>,
Adds a filter that matches only devices that belong to the given kernel subsystem.
pub fn match_attribute<T, U>(
&mut self,
attribute: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
[src]
&mut self,
attribute: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
Adds a filter that matches only devices with the given attribute value.
pub fn match_sysname<T>(&mut self, sysname: T) -> Result<(), Error> where
T: AsRef<OsStr>,
[src]
T: AsRef<OsStr>,
Adds a filter that matches only devices with the given kernel device name.
pub fn match_property<T, U>(
&mut self,
property: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
[src]
&mut self,
property: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
Adds a filter that matches only devices with the given property value.
pub fn match_tag<T>(&mut self, tag: T) -> Result<(), Error> where
T: AsRef<OsStr>,
[src]
T: AsRef<OsStr>,
Adds a filter that matches only devices with the given tag.
pub fn match_parent(&mut self, parent: &Device) -> Result<(), Error>
[src]
Includes the parent device and all devices in the subtree of the parent device.
pub fn nomatch_subsystem<T>(&mut self, subsystem: T) -> Result<(), Error> where
T: AsRef<OsStr>,
[src]
T: AsRef<OsStr>,
Adds a filter that matches only devices that don't belong to the given kernel subsystem.
pub fn nomatch_attribute<T, U>(
&mut self,
attribute: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
[src]
&mut self,
attribute: T,
value: U
) -> Result<(), Error> where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
Adds a filter that matches only devices that don't have the the given attribute value.
pub fn add_syspath<T>(&mut self, syspath: T) -> Result<(), Error> where
T: AsRef<OsStr>,
[src]
T: AsRef<OsStr>,
Includes the device with the given syspath.
pub fn scan_devices(&mut self) -> Result<Devices, Error>
[src]
Scans /sys
for devices matching the attached filters.
The devices will be sorted in dependency order.
Trait Implementations
impl AsRawWithContext<udev_enumerate> for Enumerator
[src]
pub fn as_raw(&self) -> *mut udev_enumerate
[src]
pub fn udev(&self) -> &Udev
[src]
pub fn into_raw_with_context(self) -> (*mut udev, *mut udev_enumerate)
[src]
impl Clone for Enumerator
[src]
pub fn clone(&self) -> Enumerator
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for Enumerator
[src]
impl FromRawWithContext<udev_enumerate> for Enumerator
[src]
pub unsafe fn from_raw_with_context(
udev: *mut udev,
t: *mut udev_enumerate
) -> Enumerator
[src]
udev: *mut udev,
t: *mut udev_enumerate
) -> Enumerator
Auto Trait Implementations
impl RefUnwindSafe for Enumerator
[src]
impl !Send for Enumerator
[src]
impl !Sync for Enumerator
[src]
impl Unpin for Enumerator
[src]
impl UnwindSafe for Enumerator
[src]
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>,