Struct Backlight

Source
pub struct Backlight { /* private fields */ }
Expand description

Fetch and modify brightness values of backlight controls.

Implementations§

Source§

impl Backlight

Source

pub fn actual_brightness(&self) -> Result<u64>

Source

pub fn bl_power(&self) -> Result<u64>

Source

pub fn type_(&self) -> Result<String>

Trait Implementations§

Source§

impl Brightness for Backlight

Source§

fn brightness(&self) -> Result<u64>

Source§

fn max_brightness(&self) -> Result<u64>

Source§

fn set_brightness(&self, input: u64) -> Result<()>

Source§

fn set_if_lower_than(&self, percent: u64) -> Result<()>

Sets the new brightness level if it is less than the current brightness. Read more
Source§

impl Clone for Backlight

Source§

fn clone(&self) -> Backlight

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl SysClass for Backlight

Source§

fn class() -> &'static str

Return the class of the sys object, the name of a folder in `/sys/${base}``
Source§

unsafe fn from_path_unchecked(path: PathBuf) -> Self

Create a sys object from an absolute path without checking path for validity
Source§

fn path(&self) -> &Path

Return the path of the sys object
Source§

fn base() -> &'static str

Sets the base directory, which defaults to class.
Source§

fn dir() -> PathBuf

Return the path to the sys objects, the full path of a folder in /sys/class
Source§

fn from_path(path: &Path) -> Result<Self>

Create a sys object from a path, checking it for validity
Source§

fn all() -> Result<Vec<Self>>

Retrieve all of the object instances of a sys class
Source§

fn iter() -> Box<dyn Iterator<Item = Result<Self>>>
where Self: 'static,

Retrieve all of the object instances of a sys class, with a boxed iterator
Source§

fn new(id: &str) -> Result<Self>

Create a sys object by id, checking it for validity
Source§

fn id(&self) -> &str

Return the id of the sys object
Source§

fn read_file<P: AsRef<Path>>(&self, name: P) -> Result<String>

Read a file underneath the sys object
Source§

fn parse_file<F: FromStr, P: AsRef<Path>>(&self, name: P) -> Result<F>
where F::Err: Display,

Parse a number from a file underneath the sys object
Source§

fn trim_file<P: AsRef<Path>>(&self, name: P) -> Result<String>

Read a file underneath the sys object and trim whitespace
Source§

fn write_file<P: AsRef<Path>, S: AsRef<[u8]>>( &self, name: P, data: S, ) -> Result<()>

Write a file underneath the sys object

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.