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

pub struct BatteryConfig {
    pub interval: Duration,
    pub device: String,
    pub format: String,
    pub full_format: String,
    pub missing_format: String,
    pub driver: BatteryDriver,
    pub good: u64,
    pub info: u64,
    pub warning: u64,
    pub critical: u64,
    pub allow_missing: bool,
    pub hide_missing: bool,
}

Configuration for the Battery block.

Fields

interval: Duration

Update interval in seconds

device: String

The internal power supply device in /sys/class/power_supply/ to read from.

format: String

Format string for displaying battery information. placeholders: {percentage}, {bar}, {time} and {power}

full_format: String

Format string for displaying battery information when battery is full. placeholders: {percentage}, {bar}, {time} and {power}

missing_format: String

Format string that's displayed if a battery is missing. placeholders: {percentage}, {bar}, {time} and {power}

driver: BatteryDriver

The "driver" to use for powering the block. One of "sysfs" or "upower".

good: u64

The threshold above which the remaining capacity is shown as good

info: u64

The threshold below which the remaining capacity is shown as info

warning: u64

The threshold below which the remaining capacity is shown as warning

critical: u64

The threshold below which the remaining capacity is shown as critical

allow_missing: bool

If the battery device cannot be found, do not fail and show the block anyway (sysfs only).

hide_missing: bool

If the battery device cannot be found, completely hide this block.

Trait Implementations

impl Clone for BatteryConfig[src]

impl Debug for BatteryConfig[src]

impl Default for BatteryConfig[src]

impl<'de> Deserialize<'de> for BatteryConfig where
    BatteryConfig: Default
[src]

Auto Trait Implementations

impl RefUnwindSafe for BatteryConfig[src]

impl Send for BatteryConfig[src]

impl Sync for BatteryConfig[src]

impl Unpin for BatteryConfig[src]

impl UnwindSafe for BatteryConfig[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.