[−][src]Struct mio_udev::Context
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]
&self,
dev_type: DeviceType,
dev_num: u64
) -> Result<Device, Error>
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]
&self,
subsystem: &Path,
syspath: &Path
) -> Result<Device, Error>
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:minorc128:1
- char device major:minorn3
- 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,