[][src]Struct libudev::Enumerator

pub struct Enumerator { /* fields omitted */ }

An enumeration context.

An Enumerator scans /sys for devices matching its filters. Filters are added to an Enumerator by calling its match_* and nomatch_* methods. After the filters are setup, the scan_devices() method finds devices in /sys that match the filters.

Implementations

impl Enumerator[src]

pub fn new(context: &Context) -> Result<Self>[src]

Creates a new Enumerator.

pub fn match_is_initialized(&mut self) -> Result<()>[src]

Adds a filter that matches only initialized devices.

pub fn match_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>[src]

Adds a filter that matches only devices that belong to the given kernel subsystem.

pub fn match_attribute<T: AsRef<OsStr>, U: AsRef<OsStr>>(
    &mut self,
    attribute: T,
    value: U
) -> Result<()>
[src]

Adds a filter that matches only devices with the given attribute value.

pub fn match_sysname<T: AsRef<OsStr>>(&mut self, sysname: T) -> Result<()>[src]

Adds a filter that matches only devices with the given kernel device name.

pub fn match_property<T: AsRef<OsStr>, U: AsRef<OsStr>>(
    &mut self,
    property: T,
    value: U
) -> Result<()>
[src]

Adds a filter that matches only devices with the given property value.

pub fn match_tag<T: AsRef<OsStr>>(&mut self, tag: T) -> Result<()>[src]

Adds a filter that matches only devices with the given tag.

pub fn match_parent(&mut self, parent: &Device) -> Result<()>[src]

Includes the parent device and all devices in the subtree of the parent device.

pub fn nomatch_subsystem<T: AsRef<OsStr>>(&mut self, subsystem: T) -> Result<()>[src]

Adds a filter that matches only devices that don't belong to the given kernel subsystem.

pub fn nomatch_attribute<T: AsRef<OsStr>, U: AsRef<OsStr>>(
    &mut self,
    attribute: T,
    value: U
) -> Result<()>
[src]

Adds a filter that matches only devices that don't have the the given attribute value.

pub fn add_syspath(&mut self, syspath: &Path) -> Result<()>[src]

Includes the device with the given syspath.

pub fn scan_devices(&mut self) -> Result<Devices<'_>>[src]

Scans /sys for devices matching the attached filters.

The devices will be sorted in dependency order.

Trait Implementations

impl Drop for Enumerator[src]

Auto Trait Implementations

impl RefUnwindSafe for Enumerator

impl !Send for Enumerator

impl !Sync for Enumerator

impl Unpin for Enumerator

impl UnwindSafe for Enumerator

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.