Trait gudev::prelude::DeviceExt

source ·
pub trait DeviceExt: IsA<Device> + Sealed + 'static {
Show 40 methods // Provided methods fn action(&self) -> Option<GString> { ... } fn device_file(&self) -> Option<GString> { ... } fn device_file_symlinks(&self) -> Vec<GString> { ... } fn device_number(&self) -> DeviceNumber { ... } fn device_type(&self) -> DeviceType { ... } fn devtype(&self) -> Option<GString> { ... } fn driver(&self) -> Option<GString> { ... } fn is_initialized(&self) -> bool { ... } fn name(&self) -> Option<GString> { ... } fn number(&self) -> Option<GString> { ... } fn parent(&self) -> Option<Device> { ... } fn parent_with_subsystem( &self, subsystem: &str, devtype: Option<&str> ) -> Option<Device> { ... } fn property(&self, key: &str) -> Option<GString> { ... } fn property_as_boolean(&self, key: &str) -> bool { ... } fn property_as_double(&self, key: &str) -> f64 { ... } fn property_as_int(&self, key: &str) -> i32 { ... } fn property_as_strv(&self, key: &str) -> Vec<GString> { ... } fn property_as_uint64(&self, key: &str) -> u64 { ... } fn property_keys(&self) -> Vec<GString> { ... } fn seqnum(&self) -> u64 { ... } fn subsystem(&self) -> Option<GString> { ... } fn sysfs_attr(&self, name: &str) -> Option<GString> { ... } fn sysfs_attr_as_boolean(&self, name: &str) -> bool { ... } fn sysfs_attr_as_boolean_uncached(&self, name: &str) -> bool { ... } fn sysfs_attr_as_double(&self, name: &str) -> f64 { ... } fn sysfs_attr_as_double_uncached(&self, name: &str) -> f64 { ... } fn sysfs_attr_as_int(&self, name: &str) -> i32 { ... } fn sysfs_attr_as_int_uncached(&self, name: &str) -> i32 { ... } fn sysfs_attr_as_strv(&self, name: &str) -> Vec<GString> { ... } fn sysfs_attr_as_strv_uncached(&self, name: &str) -> Vec<GString> { ... } fn sysfs_attr_as_uint64(&self, name: &str) -> u64 { ... } fn sysfs_attr_as_uint64_uncached(&self, name: &str) -> u64 { ... } fn sysfs_attr_keys(&self) -> Vec<GString> { ... } fn sysfs_attr_uncached(&self, name: &str) -> Option<GString> { ... } fn sysfs_path(&self) -> Option<GString> { ... } fn tags(&self) -> Vec<GString> { ... } fn usec_since_initialized(&self) -> u64 { ... } fn has_property(&self, key: &str) -> bool { ... } fn has_sysfs_attr(&self, key: &str) -> bool { ... } fn has_sysfs_attr_uncached(&self, key: &str) -> bool { ... }
}

Provided Methods§

source

fn action(&self) -> Option<GString>

source

fn device_file(&self) -> Option<GString>

Examples found in repository?
examples/enumerator.rs (line 11)
6
7
8
9
10
11
12
13
14
fn print_device(device: &Device) {
    println!(
        "{} (subsystem={}, sysname={}, devtype={})",
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
More examples
Hide additional examples
examples/monitor.rs (line 12)
5
6
7
8
9
10
11
12
13
14
15
fn print_device(device: &Device, action: &str) {
    println!(
        "{}: {} {} (subsystem={}, sysname={}, devtype={})",
        device.seqnum(),
        action,
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
source

fn device_number(&self) -> DeviceNumber

source

fn device_type(&self) -> DeviceType

source

fn devtype(&self) -> Option<GString>

Examples found in repository?
examples/enumerator.rs (line 12)
6
7
8
9
10
11
12
13
14
fn print_device(device: &Device) {
    println!(
        "{} (subsystem={}, sysname={}, devtype={})",
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
More examples
Hide additional examples
examples/monitor.rs (line 13)
5
6
7
8
9
10
11
12
13
14
15
fn print_device(device: &Device, action: &str) {
    println!(
        "{}: {} {} (subsystem={}, sysname={}, devtype={})",
        device.seqnum(),
        action,
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
source

fn driver(&self) -> Option<GString>

source

fn is_initialized(&self) -> bool

source

fn name(&self) -> Option<GString>

source

fn number(&self) -> Option<GString>

source

fn parent(&self) -> Option<Device>

source

fn parent_with_subsystem( &self, subsystem: &str, devtype: Option<&str> ) -> Option<Device>

source

fn property(&self, key: &str) -> Option<GString>

source

fn property_as_boolean(&self, key: &str) -> bool

source

fn property_as_double(&self, key: &str) -> f64

source

fn property_as_int(&self, key: &str) -> i32

source

fn property_as_strv(&self, key: &str) -> Vec<GString>

source

fn property_as_uint64(&self, key: &str) -> u64

source

fn property_keys(&self) -> Vec<GString>

source

fn seqnum(&self) -> u64

Examples found in repository?
examples/monitor.rs (line 8)
5
6
7
8
9
10
11
12
13
14
15
fn print_device(device: &Device, action: &str) {
    println!(
        "{}: {} {} (subsystem={}, sysname={}, devtype={})",
        device.seqnum(),
        action,
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
source

fn subsystem(&self) -> Option<GString>

Examples found in repository?
examples/enumerator.rs (line 10)
6
7
8
9
10
11
12
13
14
fn print_device(device: &Device) {
    println!(
        "{} (subsystem={}, sysname={}, devtype={})",
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
More examples
Hide additional examples
examples/monitor.rs (line 11)
5
6
7
8
9
10
11
12
13
14
15
fn print_device(device: &Device, action: &str) {
    println!(
        "{}: {} {} (subsystem={}, sysname={}, devtype={})",
        device.seqnum(),
        action,
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
source

fn sysfs_attr(&self, name: &str) -> Option<GString>

source

fn sysfs_attr_as_boolean(&self, name: &str) -> bool

source

fn sysfs_attr_as_boolean_uncached(&self, name: &str) -> bool

source

fn sysfs_attr_as_double(&self, name: &str) -> f64

source

fn sysfs_attr_as_double_uncached(&self, name: &str) -> f64

source

fn sysfs_attr_as_int(&self, name: &str) -> i32

source

fn sysfs_attr_as_int_uncached(&self, name: &str) -> i32

source

fn sysfs_attr_as_strv(&self, name: &str) -> Vec<GString>

source

fn sysfs_attr_as_strv_uncached(&self, name: &str) -> Vec<GString>

source

fn sysfs_attr_as_uint64(&self, name: &str) -> u64

source

fn sysfs_attr_as_uint64_uncached(&self, name: &str) -> u64

source

fn sysfs_attr_keys(&self) -> Vec<GString>

source

fn sysfs_attr_uncached(&self, name: &str) -> Option<GString>

source

fn sysfs_path(&self) -> Option<GString>

Examples found in repository?
examples/enumerator.rs (line 9)
6
7
8
9
10
11
12
13
14
fn print_device(device: &Device) {
    println!(
        "{} (subsystem={}, sysname={}, devtype={})",
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
More examples
Hide additional examples
examples/monitor.rs (line 10)
5
6
7
8
9
10
11
12
13
14
15
fn print_device(device: &Device, action: &str) {
    println!(
        "{}: {} {} (subsystem={}, sysname={}, devtype={})",
        device.seqnum(),
        action,
        device.sysfs_path().unwrap_or_else(|| "---".into()),
        device.subsystem().unwrap_or_else(|| "---".into()),
        device.device_file().unwrap_or_else(|| "---".into()),
        device.devtype().unwrap_or_else(|| "---".into()),
    );
}
source

fn tags(&self) -> Vec<GString>

source

fn usec_since_initialized(&self) -> u64

source

fn has_property(&self, key: &str) -> bool

source

fn has_sysfs_attr(&self, key: &str) -> bool

source

fn has_sysfs_attr_uncached(&self, key: &str) -> bool

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Device>> DeviceExt for O