pub struct Debouncer<T: Wait + InputPin> { /* private fields */ }

Implementations§

source§

impl<T: Wait + InputPin> Debouncer<T>

source

pub fn new(input: T, debounce_time: Duration) -> Self

Trait Implementations§

source§

impl<T: Wait + InputPin> ErrorType for Debouncer<T>

§

type Error = <T as ErrorType>::Error

Error type
source§

impl<T: Wait + InputPin> Wait for Debouncer<T>

source§

async fn wait_for_high(&mut self) -> Result<(), T::Error>

Wait until the pin is high. If it is already high, return immediately. Read more
source§

async fn wait_for_low(&mut self) -> Result<(), T::Error>

Wait until the pin is low. If it is already low, return immediately. Read more
source§

async fn wait_for_rising_edge(&mut self) -> Result<(), T::Error>

Wait for the pin to undergo a transition from low to high. Read more
source§

async fn wait_for_falling_edge(&mut self) -> Result<(), T::Error>

Wait for the pin to undergo a transition from high to low. Read more
source§

async fn wait_for_any_edge(&mut self) -> Result<(), T::Error>

Wait for the pin to undergo any transition, i.e low to high OR high to low.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Debouncer<T>
where T: RefUnwindSafe,

§

impl<T> Send for Debouncer<T>
where T: Send,

§

impl<T> Sync for Debouncer<T>
where T: Sync,

§

impl<T> Unpin for Debouncer<T>
where T: Unpin,

§

impl<T> UnwindSafe for Debouncer<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.