Trait esp32_simple::infra::Switch

source ·
pub trait Switch {
    // Required method
    fn toggle(&mut self) -> Result<()>;
}
Expand description

A trait representing a switch that can toggle its state.

§Errors

This trait’s toggle method returns an error if the toggle operation fails.

Required Methods§

source

fn toggle(&mut self) -> Result<()>

Toggles the state of the switch.

§Returns

Ok(()) on success.

§Errors

Returns an error if the toggle operation fails.

Implementors§

source§

impl Switch for Advertiser

source§

impl Switch for Led<'_>

source§

impl<T, MODE, TR> Switch for Button<'_, T, MODE, TR>
where T: InputPin, MODE: InputMode, TR: Trigger,