[][src]Struct rotary_encoder_hal::Rotary

pub struct Rotary<A, B> { /* fields omitted */ }

Holds current/old state and both InputPin

Methods

impl<A, B> Rotary<A, B> where
    A: InputPin,
    B: InputPin
[src]

pub fn new(pin_a: A, pin_b: B) -> Self[src]

Accepts two InputPins, these will be read on every update() InputPin: https://docs.rs/embedded-hal/0.2.3/embedded_hal/digital/v2/trait.InputPin.html

pub fn update(&mut self) -> Result<Direction, Either<A::Error, B::Error>>[src]

Call update to evaluate the next state of the encoder, propagates errors from InputPin read

Trait Implementations

impl<A: Debug, B: Debug> Debug for Rotary<A, B>[src]

impl<A: PartialEq, B: PartialEq> PartialEq<Rotary<A, B>> for Rotary<A, B>[src]

impl<A: Eq, B: Eq> Eq for Rotary<A, B>[src]

impl<A: Clone, B: Clone> Clone for Rotary<A, B>[src]

Auto Trait Implementations

impl<A, B> Unpin for Rotary<A, B> where
    A: Unpin,
    B: Unpin

impl<A, B> Send for Rotary<A, B> where
    A: Send,
    B: Send

impl<A, B> Sync for Rotary<A, B> where
    A: Sync,
    B: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]