#[repr(C)]pub struct UdevEnumerate { /* private fields */ }Expand description
Represents one device lookup/sort context..
Implementations§
Source§impl UdevEnumerate
impl UdevEnumerate
Sourcepub fn new(udev: Arc<Udev>) -> Self
pub fn new(udev: Arc<Udev>) -> Self
Creates a new UdevEnumerate.
Sourcepub const fn sysattr_match_list(&self) -> &UdevList
pub const fn sysattr_match_list(&self) -> &UdevList
Gets a reference to the sysattr match list UdevList.
Sourcepub fn sysattr_match_list_mut(&mut self) -> &mut UdevList
pub fn sysattr_match_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the sysattr match list UdevList.
Sourcepub fn set_sysattr_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_sysattr_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the sysattr match list UdevList.
Sourcepub fn with_sysattr_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_sysattr_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the sysattr match list UdevList.
Sourcepub fn add_match_sysattr(&mut self, sysattr: &str) -> Result<&UdevEntry>
pub fn add_match_sysattr(&mut self, sysattr: &str) -> Result<&UdevEntry>
Adds an entry to the match sysattr UdevEntry list.
From the libudev documentation:
Match only devices with a given /sys device attribute.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn sysattr_nomatch_list(&self) -> &UdevList
pub const fn sysattr_nomatch_list(&self) -> &UdevList
Gets a reference to the sysattr nomatch list UdevList.
Sourcepub fn sysattr_nomatch_list_mut(&mut self) -> &mut UdevList
pub fn sysattr_nomatch_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the sysattr nomatch list UdevList.
Sourcepub fn set_sysattr_nomatch_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_sysattr_nomatch_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the sysattr nomatch list UdevList.
Sourcepub fn with_sysattr_nomatch_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_sysattr_nomatch_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the sysattr nomatch list UdevList.
Sourcepub fn add_nomatch_sysattr(&mut self, sysattr: &str) -> Result<&UdevEntry>
pub fn add_nomatch_sysattr(&mut self, sysattr: &str) -> Result<&UdevEntry>
Adds an entry to the no-match sysattr UdevEntry list.
From the libudev documentation:
Match only devices without a given /sys device attribute.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn subsystem_match_list(&self) -> &UdevList
pub const fn subsystem_match_list(&self) -> &UdevList
Gets a reference to the subsystem match list UdevList.
Sourcepub fn subsystem_match_list_mut(&mut self) -> &mut UdevList
pub fn subsystem_match_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the subsystem match list UdevList.
Sourcepub fn set_subsystem_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_subsystem_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the subsystem match list UdevList.
Sourcepub fn with_subsystem_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_subsystem_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the subsystem match list UdevList.
Sourcepub fn add_match_subsystem(&mut self, subsystem: &str) -> Result<&UdevEntry>
pub fn add_match_subsystem(&mut self, subsystem: &str) -> Result<&UdevEntry>
Adds an entry to the match subsystem UdevEntry list.
From the libudev documentation:
Match only devices belonging to a certain kernel subsystem.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn subsystem_nomatch_list(&self) -> &UdevList
pub const fn subsystem_nomatch_list(&self) -> &UdevList
Gets a reference to the subsystem nomatch list UdevList.
Sourcepub fn subsystem_nomatch_list_mut(&mut self) -> &mut UdevList
pub fn subsystem_nomatch_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the subsystem nomatch list UdevList.
Sourcepub fn set_subsystem_nomatch_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_subsystem_nomatch_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the subsystem nomatch list UdevList.
Sourcepub fn with_subsystem_nomatch_list<L: Into<UdevEntryList>>(
self,
list: L,
) -> Self
pub fn with_subsystem_nomatch_list<L: Into<UdevEntryList>>( self, list: L, ) -> Self
Builder function that sets the subsystem nomatch list UdevList.
Sourcepub fn add_nomatch_subsystem(&mut self, subsystem: &str) -> Result<&UdevEntry>
pub fn add_nomatch_subsystem(&mut self, subsystem: &str) -> Result<&UdevEntry>
Adds an entry to the no-match subsystem UdevEntry list.
From the libudev documentation:
Match only devices not belonging to a certain kernel subsystem.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn sysname_match_list(&self) -> &UdevList
pub const fn sysname_match_list(&self) -> &UdevList
Gets a reference to the sysname match list UdevList.
Sourcepub fn sysname_match_list_mut(&mut self) -> &mut UdevList
pub fn sysname_match_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the sysname match list UdevList.
Sourcepub fn set_sysname_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_sysname_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the sysname match list UdevList.
Sourcepub fn with_sysname_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_sysname_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the sysname match list UdevList.
Sourcepub fn add_match_sysname(&mut self, sysname: &str) -> Result<&UdevEntry>
pub fn add_match_sysname(&mut self, sysname: &str) -> Result<&UdevEntry>
Adds an entry to the match sysname UdevEntry list.
From the libudev documentation:
Match only devices with a given /sys device name.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn properties_match_list(&self) -> &UdevList
pub const fn properties_match_list(&self) -> &UdevList
Gets a reference to the properties match list UdevList.
Sourcepub fn properties_match_list_mut(&mut self) -> &mut UdevList
pub fn properties_match_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the properties match list UdevList.
Sourcepub fn set_properties_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_properties_match_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the properties match list UdevList.
Sourcepub fn with_properties_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_properties_match_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the properties match list UdevList.
Sourcepub fn add_match_property(
&mut self,
property: &str,
value: &str,
) -> Result<&UdevEntry>
pub fn add_match_property( &mut self, property: &str, value: &str, ) -> Result<&UdevEntry>
Adds an entry to the match properties UdevEntry list.
From the libudev documentation:
Match only devices with a certain property.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Gets a reference to the tags match list UdevList.
Gets a mutable reference to the tags match list UdevList.
Sets the tags match list UdevList.
Builder function that sets the tags match list UdevList.
Sourcepub fn add_match_tag(&mut self, tag: &str) -> Result<&UdevEntry>
pub fn add_match_tag(&mut self, tag: &str) -> Result<&UdevEntry>
Adds an entry to the match tags UdevEntry list.
From the libudev documentation:
Match only devices with a certain tag.Returns Ok(UdevEntry) on success, Err(Error) otherwise.
Sourcepub const fn devices_list(&self) -> &UdevList
pub const fn devices_list(&self) -> &UdevList
Gets a reference to the devices list UdevList.
Sourcepub fn devices_list_mut(&mut self) -> &mut UdevList
pub fn devices_list_mut(&mut self) -> &mut UdevList
Gets a mutable reference to the devices list UdevList.
Sourcepub fn set_devices_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_devices_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the devices list UdevList.
Sourcepub fn with_devices_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_devices_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the devices list UdevList.
Sourcepub fn parent(&self) -> Option<&Arc<UdevDevice>>
pub fn parent(&self) -> Option<&Arc<UdevDevice>>
Gets an optional reference to the parent UdevDevice.
Sourcepub fn set_parent(&mut self, parent: Arc<UdevDevice>)
pub fn set_parent(&mut self, parent: Arc<UdevDevice>)
Sets the parent UdevDevice.
Sourcepub fn with_parent(self, parent: Arc<UdevDevice>) -> Self
pub fn with_parent(self, parent: Arc<UdevDevice>) -> Self
Builder function that sets the parent UdevDevice.
Sourcepub fn set_devices<S: IntoIterator<Item = Syspath>>(&mut self, devices: S)
pub fn set_devices<S: IntoIterator<Item = Syspath>>(&mut self, devices: S)
Sets the Syspath devices list.
Sourcepub fn with_devices<S: IntoIterator<Item = Syspath>>(self, devices: S) -> Self
pub fn with_devices<S: IntoIterator<Item = Syspath>>(self, devices: S) -> Self
Builder function that sets the Syspath devices list.
Sourcepub const fn devices_cur(&self) -> usize
pub const fn devices_cur(&self) -> usize
Gets the current index into the Syspath devices list.
Sourcepub fn set_devices_cur(&mut self, cur: usize)
pub fn set_devices_cur(&mut self, cur: usize)
Sets the current index into the Syspath devices list.
NOTE: cur must be in-bounds to set the current index, otherwise this function is a
no-op.
Sourcepub fn with_devices_cur(self, cur: usize) -> Self
pub fn with_devices_cur(self, cur: usize) -> Self
Builder function that sets the current index into the Syspath devices list.
NOTE: cur must be in-bounds to set the current index, otherwise this function is a
no-op.
Sourcepub const fn devices_max(&self) -> usize
pub const fn devices_max(&self) -> usize
Gets the maximum number of Syspath devices.
Sourcepub fn set_devices_max(&mut self, max: usize)
pub fn set_devices_max(&mut self, max: usize)
Sourcepub fn with_devices_max(self, max: usize) -> Self
pub fn with_devices_max(self, max: usize) -> Self
Sourcepub const fn devices_uptodate(&self) -> bool
pub const fn devices_uptodate(&self) -> bool
Gets whether the Syspath devices list is up-to-date.
Sourcepub fn set_devices_uptodate(&mut self, val: bool)
pub fn set_devices_uptodate(&mut self, val: bool)
Sets whether the Syspath devices list is up-to-date.
Sourcepub fn with_devices_uptodate(self, val: bool) -> Self
pub fn with_devices_uptodate(self, val: bool) -> Self
Builder function that sets whether the Syspath devices list is up-to-date.
Sourcepub const fn match_is_initialized(&self) -> bool
pub const fn match_is_initialized(&self) -> bool
Gets whether the match lists are initialized.
Sourcepub fn set_match_is_initialized(&mut self, val: bool)
pub fn set_match_is_initialized(&mut self, val: bool)
Sets whether the match lists are initialized.
Sourcepub fn with_match_is_initialized(self, val: bool) -> Self
pub fn with_match_is_initialized(self, val: bool) -> Self
Builder function that sets whether the match lists are initialized.
Sourcepub fn add_syspath(&mut self, syspath: &str) -> Result<()>
pub fn add_syspath(&mut self, syspath: &str) -> Result<()>
Adds a devices to the list of devices.
From the libudev documentation:
Add a device to the list of devices, to retrieve it back sorted in dependency order.Returns: Ok(()) on success, Err(Error) otherwise.
Sourcepub fn scan_devices(&mut self) -> Result<()>
pub fn scan_devices(&mut self) -> Result<()>
Scan /sys for devices which match the given filters.
From the libudev documentation:
Scan /sys for all devices which match the given filters. No matches
will return all currently available devices.Returns: Ok(()) on success, Err(Error) otherwise.
Sourcepub fn scan_subsystems(&mut self) -> Result<()>
pub fn scan_subsystems(&mut self) -> Result<()>
Scans /sys for all kernel subsystems.
From libudev documentation:
Scan /sys for all kernel subsystems, including buses, classes, drivers.Returns: Ok(()) on success, Err(Error) otherwise.
Trait Implementations§
Source§impl Clone for UdevEnumerate
impl Clone for UdevEnumerate
Source§fn clone(&self) -> UdevEnumerate
fn clone(&self) -> UdevEnumerate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more