Struct udev::enumerator::Enumerator
[-]
[+]
[src]
pub struct Enumerator<'u> { // some fields omitted }
Methods
impl<'u> Enumerator<'u>
fn udev(&self) -> &Udev
Get the udev context.
fn match_subsystem(self, subsystem: &str) -> Enumerator<'u>
Include devices with the specified subsystem.
All devices added by future scans will match either the specified subsystem or a subsystem specified in a previous invocation of this function (on this enumerator). If this function has never been called, devices will not be filtered by subsystem.
fn match_not_subsystem(self, subsystem: &str) -> Enumerator<'u>
Exclude devices with the specified subsystem.
No device added by a future scan will have the specified subsystem.
fn match_attribute(self, attr: &str, value: Option<&str>) -> Enumerator<'u>
Only include devices with an attribute.
All devices added by future scans will have the specified attribute with the (optionally) specified value.
fn match_not_attribute(self, attr: &str, value: Option<&str>) -> Enumerator<'u>
Exclude devices with an attribute.
No device added by future scans will have the specified attribute with the (optionally) specified value.
fn match_property(self, attr: &str, value: Option<&str>) -> Enumerator<'u>
Only include devices with a property.
All devices added by future scans will have the specified property with the (optionally) specified value.
fn match_parent(self, parent: &Device) -> Enumerator<'u>
Only include the specified device and its children.
All devices added by future scans (until the parent is changed/cleared) will have/be the specified parent.
fn clear_parent(self) -> Enumerator<'u>
Remove the parent restriction.
Clear the current parent match. Future scans will add devices regardless of their parents.
fn match_tag(self, tag: &str) -> Enumerator<'u>
Only include devices with the specified tag.
All devices added by future scans will match the specified tag.
fn match_is_initialized(self) -> Enumerator<'u>
Include only initialized devices.
All devices added by future scans will be initialized.
fn match_sysname(self, sysname: &str) -> Enumerator<'u>
Include devices with the specified sysname.
All devices added by future scans will match either the specified sysname or a sysname specified in a previous invocation of this function (on this enumerator). If this function has never been called, devices will not be filtered by sysname.
fn add_device(self, device: &Device) -> Enumerator<'u>
Manually include a device.
Manually add a device to the enumerator bypassing matches. According to the libudev documentation, this can be useful for determine device dependency order (see iter below).
fn scan_subsystems(self) -> Enumerator<'u>
Scan subsystems
Scan sysfs for subsystems matching all previously applied constraints and add them to the enumerator.
fn scan_devices(self) -> Enumerator<'u>
Scan devices
Scan sysfs for devices matching all previously applied constraints and add them to the enumerator.
fn iter(&self) -> DeviceIterator
Iterate over all devices that have been added to this iterator in dependency order.
Note
Enumerators are not prepopulated with devices. If you haven't either manually added devices
to the enumerator (add_device
), or haven't called a scan method (scan_subsystems
or
scan_devices
), this iterator will be empty.
fn iter_paths(&self) -> DevicePathIterator
Same as iter
but avoid creating device objects.