Struct udev::device::Device
[-]
[+]
[src]
pub struct Device<'u> {
// some fields omitted
}Methods
impl<'u> Device<'u>
fn udev(&self) -> &Udev
Get the udev context.
fn parent(&self) -> Option<Device>
Get the device's parent if one exists.
fn parent_with_subsystem(&self, subsystem: &str) -> Option<Device>
Get the first parent with the specified subsystem.
fn parent_with_subsystem_devtype(&self, subsystem: &str, devtype: &str) -> Option<Device>
Get the first parent with the specified subsystem and devtype.
fn attribute<'s>(&'s self, attr: &str) -> Result<&'s str, IoError>
Read a sysfs attribute.
fn set_attribute(&self, attr: &str, value: &str) -> Result<(), IoError>
Write a sysfs attribute.
fn devpath<'s>(&'s self) -> &'s str
Get the path to the device (minus /sys).
fn syspath<'s>(&'s self) -> Path
Get the full path to the device (including /sys).
fn sysname<'s>(&'s self) -> &'s str
Get the device name.
E.g. wlan0
fn subsystem<'s>(&'s self) -> Option<&'s str>
Get the devices subsystem
fn devtype<'s>(&'s self) -> Option<&'s str>
Get the devices devtype
fn sysnum(&self) -> Option<u64>
Get the devices sysnum.
E.g. the X in ethX, wlanX, etc.
fn devnum(&self) -> Option<Devnum>
Get the device's devnum.
fn driver(&self) -> Option<&str>
Get the device's driver.
fn devnode(&self) -> Option<Path>
Get the device's devnode
E.g. /dev/sda
fn iter_devlinks(&self) -> DevlinkIterator
Iterate over the device's devlinks
E.g. the symlinks in /dev/disk/by-*/
fn iter_tags(&self) -> TagIterator
Iterate over the device's tags.
fn iter_properties(&self) -> PropertyIterator
Iterate over the device's properties.
fn iter_attributes(&self) -> AttributeIterator
Iterate over the device's sysfs attribute names
fn time_since_initialized(&self) -> Option<Duration>
Get the time since the device was initialized by udev.
fn is_initialized(&self) -> bool
Determine if the device has been initialized.
fn has_tag(&self, tag: &str) -> bool
Check whether the device is tagged with a given tag.