[][src]Struct i3status_rs::blocks::battery::UpowerDevice

pub struct UpowerDevice {
    device_path: String,
    con: Connection,
}

Represents a battery known to UPower.

Fields

device_path: Stringcon: Connection

Implementations

impl UpowerDevice[src]

pub fn from_device(device: &str) -> Result<Self, Error>[src]

Create the UPower device from the device string, which is converted to the path "/org/freedesktop/UPower/devices/battery_<device>", except if device equals "DisplayDevice", in which case it is converted to the path "/org/freedesktop/UPower/devices/DisplayDevice". Raises an error if D-Bus cannot connect to this device, or if the device is not a battery.

pub fn monitor(&self, id: usize, update_request: Sender<Task>)[src]

Monitor UPower property changes in a separate thread and send updates via the update_request channel.

Trait Implementations

impl BatteryDevice for UpowerDevice[src]

Auto Trait Implementations

impl !RefUnwindSafe for UpowerDevice[src]

impl !Send for UpowerDevice[src]

impl !Sync for UpowerDevice[src]

impl Unpin for UpowerDevice[src]

impl !UnwindSafe for UpowerDevice[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.