Struct Button
pub struct Button { /* private fields */ }Implementations§
§impl Button
impl Button
pub fn new(switch: SwitchPin) -> Button
pub fn is_pressed(&self) -> bool
pub fn is_released(&self) -> bool
pub fn wait_for_released(&mut self) -> impl Future<Output = ()>
Available on crate feature external-interrupts only.
pub fn wait_for_released(&mut self) -> impl Future<Output = ()>
external-interrupts only.Waits for the button to be released.
Returns immediately if it is already being released.
pub fn wait_for_pressed(&mut self) -> impl Future<Output = ()>
Available on crate feature external-interrupts only.
pub fn wait_for_pressed(&mut self) -> impl Future<Output = ()>
external-interrupts only.Waits for the button to be pressed.
Returns immediately if it is already being pressed.
pub fn wait_for_next_press(&mut self) -> impl Future<Output = ()>
Available on crate feature external-interrupts only.
pub fn wait_for_next_press(&mut self) -> impl Future<Output = ()>
external-interrupts only.Waits for the button to be pressed after first being released.
pub fn wait_for_next_release(&mut self) -> impl Future<Output = ()>
Available on crate feature external-interrupts only.
pub fn wait_for_next_release(&mut self) -> impl Future<Output = ()>
external-interrupts only.Waits for the button to be released after first being pressed.
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnsafeUnpin for Button
impl UnwindSafe for Button
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