Brightness

Trait Brightness 

Source
pub trait Brightness {
    // Required methods
    fn device_name(&self) -> impl Future<Output = Result<String, Error>> + Send;
    fn friendly_device_name(
        &self,
    ) -> impl Future<Output = Result<String, Error>> + Send;
    fn get(&self) -> impl Future<Output = Result<u32, Error>> + Send;
    fn set(
        &mut self,
        percentage: u32,
    ) -> impl Future<Output = Result<(), Error>> + Send;
}
Available on crate feature async only.
Expand description

Async interface to get and set brightness.

Required Methods§

Source

fn device_name(&self) -> impl Future<Output = Result<String, Error>> + Send

Returns the device name.

Source

fn friendly_device_name( &self, ) -> impl Future<Output = Result<String, Error>> + Send

Returns a human-readable device name suitable for display to users, which may differ from the technical device identifier returned by device_name.

Source

fn get(&self) -> impl Future<Output = Result<u32, Error>> + Send

Returns the current brightness as a percentage.

Source

fn set( &mut self, percentage: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Sets the brightness as a percentage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§