[][src]Struct mio_udev::Context

pub struct Context { /* fields omitted */ }

A libudev context.

Methods

impl Context[src]

pub fn new() -> Result<Context, Error>[src]

Creates a new context.

pub fn device_from_syspath(&self, syspath: &Path) -> Result<Device, Error>[src]

Creates a device for a given syspath.

The syspath parameter should be a path to the device file within the sysfs file system, e.g., /sys/devices/virtual/tty/tty0.

pub fn device_from_devnum(
    &self,
    dev_type: DeviceType,
    dev_num: u64
) -> Result<Device, Error>
[src]

Creates a device for a given device type and number.

pub fn device_from_subsystem_sysname(
    &self,
    subsystem: &Path,
    syspath: &Path
) -> Result<Device, Error>
[src]

Creates a device from a given subsystem and sysname.

pub fn device_from_device_id(&self, device_id: &Path) -> Result<Device, Error>[src]

Creates a device from a given device id.

The device id should be in one of these formats:

  • b8:2 - block device major:minor
  • c128:1 - char device major:minor
  • n3 - network device ifindex
  • +sound:card29 - kernel driver core subsystem:device name

pub fn device_from_environment(&self) -> Result<Device, Error>[src]

Creates a device from the current environment (see environ(7)).

Each key-value pair is interpreted in the same way as if it was received in an uevent (see udev_monitor_receive_device(3)). The keys DEVPATH, SUBSYSTEM, ACTION, and SEQNUM are mandatory.

Trait Implementations

impl AsRaw<udev> for Context[src]

impl Clone for Context[src]

impl Drop for Context[src]

impl FromRaw<udev> for Context[src]

Auto Trait Implementations

impl RefUnwindSafe for Context

impl !Send for Context

impl !Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.