pub trait Switch { // Required method fn toggle(&mut self) -> Result<()>; }
A trait representing a switch that can toggle its state.
This trait’s toggle method returns an error if the toggle operation fails.
toggle
Toggles the state of the switch.
Ok(()) on success.
Ok(())
Returns an error if the toggle operation fails.