UdevList

Struct UdevList 

Source
pub struct UdevList { /* private fields */ }
Expand description

Represents a list wrapper around a UdevEntryList.

Implementations§

Source§

impl UdevList

Source

pub const fn new(udev: Arc<Udev>) -> Self

Creates a new UdevList.

Source

pub const fn create(udev: Arc<Udev>, list: UdevEntryList) -> Self

Creates a new UdevList from the provided parameters.

Source

pub fn iter(&self) -> Iter<'_, UdevEntry>

Gets an Iterator over UdevEntry items.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, UdevEntry>

Gets an Iterator over UdevEntry items.

Source

pub fn list(&self) -> &UdevEntryList

Gets a reference to the UdevEntryList.

Source

pub fn list_mut(&mut self) -> &mut UdevEntryList

Gets a mutable reference to the UdevEntryList.

Source

pub fn set_list<L: Into<UdevEntryList>>(&mut self, list: L)

Sets the UdevEntryList.

Source

pub fn with_list<L: Into<UdevEntryList>>(self, list: L) -> Self

Builder function that sets the UdevEntryList.

Source

pub fn len(&self) -> usize

Gets the length of the UdevEntry list.

Source

pub fn is_empty(&self) -> bool

Gets whether the UdevEntryList is empty.

Source

pub fn clear(&mut self)

Clears the list of all entries.

Source

pub fn entry(&self) -> Option<&UdevEntry>

Gets an optional reference to the first UdevEntry in the UdevEntryList.

Source

pub fn entry_mut(&mut self) -> Option<&mut UdevEntry>

Gets an optional mutable reference to the first UdevEntry in the UdevEntryList.

Source

pub fn entry_by_name(&self, name: &str) -> Option<&UdevEntry>

Gets an optional reference to an UdevEntry with a matching name.

Source

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.

Source

pub fn next_entry(&self) -> Option<&UdevEntry>

Gets the next UdevEntry in the list.

Source

pub fn next_entry_mut(&mut self) -> Option<&mut UdevEntry>

Gets the next UdevEntry in the list.

Source

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.

Source

pub fn remove_entry(&mut self, name: &str)

Removes an UdevEntry if an entry exists with a matching name.

Source

pub const fn entries_cur(&self) -> usize

Gets the current UdevEntry.

Source

pub const fn entries_max(&self) -> usize

Gets the maximum number of UdevEntry items.

Source

pub const fn unique(&self) -> bool

Gets whether the UdevList is unique.

Source

pub fn has_tag(&self, device: &UdevDevice) -> bool

Gets whether the UdevDevice matches an UdevEntry in the list.

Trait Implementations§

Source§

impl Clone for UdevList

Source§

fn clone(&self) -> UdevList

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UdevList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UdevList

Source§

fn default() -> UdevList

Returns the “default value” for a type. Read more
Source§

impl PartialEq for UdevList

Source§

fn eq(&self, other: &UdevList) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UdevList

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.