Struct udev::Enumerator [−][src]
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<Self>
[src]
Creates a new Enumerator.
pub fn with_udev(udev: Udev) -> Result<Self>
[src]
Creates a new Enumerator
with an existing Udev
instance
pub fn match_is_initialized(&mut self) -> Result<()>
[src]
Adds a filter that matches only initialized devices.
pub fn match_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>
[src]
Adds a filter that matches only devices that belong to the given kernel subsystem.
pub fn match_attribute<T: AsRef<OsStr>, U: AsRef<OsStr>>(
&mut self,
attribute: T,
value: U
) -> Result<()>
[src]
&mut self,
attribute: T,
value: U
) -> Result<()>
Adds a filter that matches only devices with the given attribute value.
pub fn match_sysname<T: AsRef<OsStr>>(&mut self, sysname: T) -> Result<()>
[src]
Adds a filter that matches only devices with the given kernel device name.
pub fn match_property<T: AsRef<OsStr>, U: AsRef<OsStr>>(
&mut self,
property: T,
value: U
) -> Result<()>
[src]
&mut self,
property: T,
value: U
) -> Result<()>
Adds a filter that matches only devices with the given property value.
pub fn match_tag<T: AsRef<OsStr>>(&mut self, tag: T) -> Result<()>
[src]
Adds a filter that matches only devices with the given tag.
pub fn match_parent(&mut self, parent: &Device) -> Result<()>
[src]
Includes the parent device and all devices in the subtree of the parent device.
pub fn nomatch_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>
[src]
Adds a filter that matches only devices that don’t belong to the given kernel subsystem.
pub fn nomatch_attribute<T: AsRef<OsStr>, U: AsRef<OsStr>>(
&mut self,
attribute: T,
value: U
) -> Result<()>
[src]
&mut self,
attribute: T,
value: U
) -> Result<()>
Adds a filter that matches only devices that don’t have the the given attribute value.
pub fn add_syspath<T: AsRef<OsStr>>(&mut self, syspath: T) -> Result<()>
[src]
Includes the device with the given syspath.
pub fn scan_devices(&mut self) -> Result<Devices>
[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]
fn as_raw(&self) -> *mut udev_enumerate
[src]
fn udev(&self) -> &Udev
[src]
fn into_raw_with_context(self) -> (*mut udev, *mut udev_enumerate)
[src]
impl Clone for Enumerator
[src]
fn clone(&self) -> Self
[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]
unsafe fn from_raw_with_context(udev: *mut udev, t: *mut udev_enumerate) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for Enumerator
impl !Send for Enumerator
impl !Sync for Enumerator
impl Unpin for Enumerator
impl UnwindSafe for Enumerator
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>,