Struct UdevEnumerate

Source
#[repr(C)]
pub struct UdevEnumerate { /* private fields */ }
Expand description

Represents one device lookup/sort context..

Implementations§

Source§

impl UdevEnumerate

Source

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

Creates a new UdevEnumerate.

Source

pub fn udev(&self) -> &Arc<Udev>

Gets a reference to the Udev object.

Source

pub const fn sysattr_match_list(&self) -> &UdevList

Gets a reference to the sysattr match list UdevList.

Source

pub fn sysattr_match_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the sysattr match list UdevList.

Source

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

Sets the sysattr match list UdevList.

Source

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

Builder function that sets the sysattr match list UdevList.

Source

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.

Source

pub const fn sysattr_nomatch_list(&self) -> &UdevList

Gets a reference to the sysattr nomatch list UdevList.

Source

pub fn sysattr_nomatch_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the sysattr nomatch list UdevList.

Source

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

Sets the sysattr nomatch list UdevList.

Source

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

Builder function that sets the sysattr nomatch list UdevList.

Source

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.

Source

pub const fn subsystem_match_list(&self) -> &UdevList

Gets a reference to the subsystem match list UdevList.

Source

pub fn subsystem_match_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the subsystem match list UdevList.

Source

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

Sets the subsystem match list UdevList.

Source

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

Builder function that sets the subsystem match list UdevList.

Source

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.

Source

pub const fn subsystem_nomatch_list(&self) -> &UdevList

Gets a reference to the subsystem nomatch list UdevList.

Source

pub fn subsystem_nomatch_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the subsystem nomatch list UdevList.

Source

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

Sets the subsystem nomatch list UdevList.

Source

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

Builder function that sets the subsystem nomatch list UdevList.

Source

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.

Source

pub const fn sysname_match_list(&self) -> &UdevList

Gets a reference to the sysname match list UdevList.

Source

pub fn sysname_match_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the sysname match list UdevList.

Source

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

Sets the sysname match list UdevList.

Source

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

Builder function that sets the sysname match list UdevList.

Source

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.

Source

pub const fn properties_match_list(&self) -> &UdevList

Gets a reference to the properties match list UdevList.

Source

pub fn properties_match_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the properties match list UdevList.

Source

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

Sets the properties match list UdevList.

Source

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

Builder function that sets the properties match list UdevList.

Source

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.

Source

pub const fn tags_match_list(&self) -> &UdevList

Gets a reference to the tags match list UdevList.

Source

pub fn tags_match_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the tags match list UdevList.

Source

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

Sets the tags match list UdevList.

Source

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

Builder function that sets the tags match list UdevList.

Source

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.

Source

pub const fn devices_list(&self) -> &UdevList

Gets a reference to the devices list UdevList.

Source

pub fn devices_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the devices list UdevList.

Source

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

Sets the devices list UdevList.

Source

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

Builder function that sets the devices list UdevList.

Source

pub fn parent(&self) -> Option<&Arc<UdevDevice>>

Gets an optional reference to the parent UdevDevice.

Source

pub fn set_parent(&mut self, parent: Arc<UdevDevice>)

Sets the parent UdevDevice.

Source

pub fn with_parent(self, parent: Arc<UdevDevice>) -> Self

Builder function that sets the parent UdevDevice.

Source

pub fn devices(&self) -> &[Syspath]

Gets a reference to the Syspath devices list.

Source

pub fn set_devices<S: IntoIterator<Item = Syspath>>(&mut self, devices: S)

Sets the Syspath devices list.

Source

pub fn with_devices<S: IntoIterator<Item = Syspath>>(self, devices: S) -> Self

Builder function that sets the Syspath devices list.

Source

pub const fn devices_cur(&self) -> usize

Gets the current index into the Syspath devices list.

Source

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.

Source

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.

Source

pub const fn devices_max(&self) -> usize

Gets the maximum number of Syspath devices.

Source

pub fn set_devices_max(&mut self, max: usize)

Sets the maximum number of Syspath devices.

NOTE if max is greater than the current Syspath devices list capacity, additional space will be reserved to avoid frequent reallocations.

Source

pub fn with_devices_max(self, max: usize) -> Self

Builder function that sets the maximum number of Syspath devices.

NOTE if max is greater than the current Syspath devices list capacity, additional space will be reserved to avoid frequent reallocations.

Source

pub const fn devices_uptodate(&self) -> bool

Gets whether the Syspath devices list is up-to-date.

Source

pub fn set_devices_uptodate(&mut self, val: bool)

Sets whether the Syspath devices list is up-to-date.

Source

pub fn with_devices_uptodate(self, val: bool) -> Self

Builder function that sets whether the Syspath devices list is up-to-date.

Source

pub const fn match_is_initialized(&self) -> bool

Gets whether the match lists are initialized.

Source

pub fn set_match_is_initialized(&mut self, val: bool)

Sets whether the match lists are initialized.

Source

pub fn with_match_is_initialized(self, val: bool) -> Self

Builder function that sets whether the match lists are initialized.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> UdevEnumerate

Returns a copy 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 UdevEnumerate

Source§

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

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

impl Default for UdevEnumerate

Source§

fn default() -> UdevEnumerate

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

impl PartialEq for UdevEnumerate

Source§

fn eq(&self, other: &UdevEnumerate) -> 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 UdevEnumerate

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.