[][src]Struct i3status_rs::blocks::backlight::BacklitDevice

pub struct BacklitDevice {
    max_brightness: u64,
    device_path: PathBuf,
    root_scaling: f64,
}

Represents a physical backlit device whose brightness level can be queried.

Fields

max_brightness: u64device_path: PathBufroot_scaling: f64

Implementations

impl BacklitDevice[src]

pub fn default(root_scaling: f64) -> Result<Self, Error>[src]

Use the default backlit device, i.e. the first one found in the /sys/class/backlight directory.

pub fn from_device(device: String, root_scaling: f64) -> Result<Self, Error>[src]

Use the backlit device device. Returns an error if a directory for that device is not found.

pub fn brightness(&self) -> Result<u64, Error>[src]

Query the brightness value for this backlit device, as a percent.

pub fn set_brightness(&self, value: u64) -> Result<(), Error>[src]

Set the brightness value for this backlit device, as a percent.

fn set_brightness_via_dbus(&self, raw_value: u64) -> Result<(), Error>[src]

pub fn brightness_file(&self) -> PathBuf[src]

The brightness file itself.

Auto Trait Implementations

impl RefUnwindSafe for BacklitDevice[src]

impl Send for BacklitDevice[src]

impl Sync for BacklitDevice[src]

impl Unpin for BacklitDevice[src]

impl UnwindSafe for BacklitDevice[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.