Struct mio_udev::Context [−][src]
pub struct Context { /* fields omitted */ }
A libudev context.
Methods
impl Context
[src]
impl Context
pub fn new() -> Result<Context, Error>
[src]
pub fn new() -> Result<Context, Error>
Creates a new context.
pub fn device_from_syspath(&self, syspath: &Path) -> Result<Device, Error>
[src]
pub fn device_from_syspath(&self, syspath: &Path) -> Result<Device, Error>
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]
pub fn device_from_devnum(
&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]
pub fn device_from_subsystem_sysname(
&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]
pub fn device_from_device_id(&self, device_id: &Path) -> Result<Device, Error>
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]
pub fn device_from_environment(&self) -> Result<Device, Error>
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 FromRaw<udev> for Context
[src]
impl FromRaw<udev> for Context
unsafe fn from_raw(ptr: *mut udev) -> Context
[src]
unsafe fn from_raw(ptr: *mut udev) -> Context
Create an object from a given raw pointer. Read more
impl AsRaw<udev> for Context
[src]
impl AsRaw<udev> for Context
fn as_raw(&self) -> *mut udev
[src]
fn as_raw(&self) -> *mut udev
Get a reference of the underlying struct. Read more
fn into_raw(self) -> *mut udev
[src]
fn into_raw(self) -> *mut udev
Convert the object into the underlying pointer. Read more
impl Clone for Context
[src]
impl Clone for Context
fn clone(&self) -> Context
[src]
fn clone(&self) -> Context
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Drop for Context
[src]
impl Drop for Context