[−][src]Struct i3status_rs::blocks::backlight::BacklitDevice
Represents a physical backlit device whose brightness level can be queried.
Fields
max_brightness: u64
device_path: PathBuf
root_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]
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>,