[−][src]Struct i3status_rs::blocks::battery::UpowerDevice
Represents a battery known to UPower.
Fields
device_path: String
con: 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,