pub struct DBusPowerStateProperty {
    pub busname: &'static str,
    pub path: &'static str,
    pub interface: &'static str,
    pub property: &'static str,
    pub power_state: PowerState,
    pub is_active: fn(s: &str) -> bool,
    pub update: fn(st: &mut HostState, new: bool),
}
Expand description

A collection of information pertaining to the dbus representation of an attribute of host power state.

Fields

busname: &'static str

The bus name of the service from which we obtain the current state.

path: &'static str

The path of the object we retrieve the state from.

interface: &'static str

The interface of the object via which we retrieve the state.

property: &'static str

The specific property within the interface that we query to retrieve the state.

power_state: PowerState

Which PowerState this property pertains to. The datatype here is a slight kludge in that PowerState is mostly intended to represent a setting of a sensor rather than something about the host, but it’s a close-enough fit that I’m reusing it at least for now…

is_active: fn(s: &str) -> bool

How to map the string retrieved from dbus to the on/off state of the attribute.

update: fn(st: &mut HostState, new: bool)

How to update this property within a HostState.

Implementations

Retrieve the current state of the property represented by self from dbus.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.