pub struct UdevList { /* private fields */ }Expand description
Represents a list wrapper around a UdevEntryList.
Implementations§
Source§impl UdevList
impl UdevList
Sourcepub const fn create(udev: Arc<Udev>, list: UdevEntryList) -> Self
pub const fn create(udev: Arc<Udev>, list: UdevEntryList) -> Self
Creates a new UdevList from the provided parameters.
Sourcepub fn list(&self) -> &UdevEntryList
pub fn list(&self) -> &UdevEntryList
Gets a reference to the UdevEntryList.
Sourcepub fn list_mut(&mut self) -> &mut UdevEntryList
pub fn list_mut(&mut self) -> &mut UdevEntryList
Gets a mutable reference to the UdevEntryList.
Sourcepub fn set_list<L: Into<UdevEntryList>>(&mut self, list: L)
pub fn set_list<L: Into<UdevEntryList>>(&mut self, list: L)
Sets the UdevEntryList.
Sourcepub fn with_list<L: Into<UdevEntryList>>(self, list: L) -> Self
pub fn with_list<L: Into<UdevEntryList>>(self, list: L) -> Self
Builder function that sets the UdevEntryList.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Gets whether the UdevEntryList is empty.
Sourcepub fn entry(&self) -> Option<&UdevEntry>
pub fn entry(&self) -> Option<&UdevEntry>
Gets an optional reference to the first UdevEntry in the UdevEntryList.
Sourcepub fn entry_mut(&mut self) -> Option<&mut UdevEntry>
pub fn entry_mut(&mut self) -> Option<&mut UdevEntry>
Gets an optional mutable reference to the first UdevEntry in the UdevEntryList.
Sourcepub fn entry_by_name(&self, name: &str) -> Option<&UdevEntry>
pub fn entry_by_name(&self, name: &str) -> Option<&UdevEntry>
Gets an optional reference to an UdevEntry with a matching name.
Sourcepub fn entry_by_name_mut(&mut self, name: &str) -> Option<&mut UdevEntry>
pub fn entry_by_name_mut(&mut self, name: &str) -> Option<&mut UdevEntry>
Gets an optional mutable reference to an UdevEntry with a matching name.
Sourcepub fn next_entry(&self) -> Option<&UdevEntry>
pub fn next_entry(&self) -> Option<&UdevEntry>
Gets the next UdevEntry in the list.
Sourcepub fn next_entry_mut(&mut self) -> Option<&mut UdevEntry>
pub fn next_entry_mut(&mut self) -> Option<&mut UdevEntry>
Gets the next UdevEntry in the list.
Sourcepub fn add_entry(&mut self, name: &str, value: &str) -> Option<&UdevEntry>
pub fn add_entry(&mut self, name: &str, value: &str) -> Option<&UdevEntry>
Adds an entry to the list.
If an UdevEntry with the same name exists, the value will be updated.
If value is empty, the entry value with be empty.
Sourcepub fn remove_entry(&mut self, name: &str)
pub fn remove_entry(&mut self, name: &str)
Removes an UdevEntry if an entry exists with a matching name.
Sourcepub const fn entries_cur(&self) -> usize
pub const fn entries_cur(&self) -> usize
Gets the current UdevEntry.
Sourcepub const fn entries_max(&self) -> usize
pub const fn entries_max(&self) -> usize
Gets the maximum number of UdevEntry items.
Sourcepub fn has_tag(&self, device: &UdevDevice) -> bool
pub fn has_tag(&self, device: &UdevDevice) -> bool
Gets whether the UdevDevice matches an UdevEntry in the list.