Struct udev::Enumerator
[−]
[src]
pub struct Enumerator { /* fields omitted */ }
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.
Methods
impl Enumerator
[src]
fn new(context: &Context) -> Result<Self>
[src]
Creates a new Enumerator.
fn match_is_initialized(&mut self) -> Result<()>
[src]
Adds a filter that matches only initialized devices.
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.
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.
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.
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.
fn match_tag<T: AsRef<OsStr>>(&mut self, tag: T) -> Result<()>
[src]
Adds a filter that matches only devices with the given tag.
fn match_parent(&mut self, parent: &Device) -> Result<()>
[src]
Includes the parent device and all devices in the subtree of the parent device.
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.
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.
fn add_syspath(&mut self, syspath: &Path) -> Result<()>
[src]
Includes the device with the given syspath.
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 Clone for Enumerator
[src]
fn clone(&self) -> Enumerator
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Drop for Enumerator
[src]
impl AsRaw<udev_enumerate> for Enumerator
[src]
fn as_raw(&self) -> *mut udev_enumerate
[src]
Get a reference of the underlying struct. Read more
fn into_raw(self) -> *mut udev_enumerate
[src]
Convert the object into the underlying pointer. Read more
impl FromRawWithContext<udev_enumerate> for Enumerator
[src]
unsafe fn from_raw(context: &Context, ptr: *mut udev_enumerate) -> Enumerator
[src]
Create an object from a given raw pointer and the matching context. Read more