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