[−][src]Struct rust_lcd::Device
A single backlight device that can be toggled ON and OFF.
Examples
use std::path::Path; let path = Path::new("/sys/class/backlight/intel_backlight"); let dev = Device::new(path); assert_eq!(dev.bl_power(), path.join(BL_POWER)); assert!(dev.toggle().is_err()); // we don't have permission
Methods
impl Device
[src]
pub fn new<P: AsRef<Path>>(path: P) -> Self
[src]
Creates a new device located at path
.
pub fn path(&self) -> &Path
[src]
Returns the path of the device.
pub fn bl_power(&self) -> &Path
[src]
Returns the path of the device power controller.
pub fn toggle(&self) -> Result<i32>
[src]
Toggles the state of the device ON and OFF.
The return value is either a std::io::Error
or the new state of the device.
Trait Implementations
Auto Trait Implementations
impl Send for Device
impl Unpin for Device
impl Sync for Device
impl UnwindSafe for Device
impl RefUnwindSafe for Device
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,