pub struct SysfsActuator { /* private fields */ }Expand description
Actuator that writes a value to a /sys filesystem file.
Common uses:
- Fan PWM control:
/sys/class/hwmon/hwmon0/pwm1(0–255) - LED brightness:
/sys/class/leds/led0/brightness(0–255) - CPU governor:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
The scale field multiplies the command value before writing
(e.g., 1.0 for direct, 255.0 if command is 0.0–1.0 and output is 0–255).
Implementations§
Trait Implementations§
Source§impl ActuatorDevice for SysfsActuator
impl ActuatorDevice for SysfsActuator
Source§fn kind(&self) -> ActuatorKind
fn kind(&self) -> ActuatorKind
Actuator type.
Source§fn command(&self, cmd: &ActuatorCommand) -> Result<(), String>
fn command(&self, cmd: &ActuatorCommand) -> Result<(), String>
Send a command to the actuator. Returns
Ok(()) on success.Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Whether the actuator is currently available/connected.
Auto Trait Implementations§
impl Freeze for SysfsActuator
impl RefUnwindSafe for SysfsActuator
impl Send for SysfsActuator
impl Sync for SysfsActuator
impl Unpin for SysfsActuator
impl UnsafeUnpin for SysfsActuator
impl UnwindSafe for SysfsActuator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more