[−][src]Struct rmicrobit::buttons::monitors::dual::Monitor
Wrapper for two PollButton
s generating click events on release.
The buttons don't have to be the micro:bit's built-in buttons, though the
generated Event
s include 'A' and 'B' in their names.
Methods
impl<A: PollButton, B: PollButton> Monitor<A, B>
[src]
pub fn new(button_a: A, button_b: B) -> Monitor<A, B>
[src]
Takes ownership of two PollButton
s and returns a Monitor
.
pub fn free(self) -> (A, B)
[src]
Gives the underlying PollButton
instances back.
pub fn poll(&mut self) -> Option<Event>
[src]
Polls both buttons and filters for events.
If both buttons have been pressed, returns Some(ClickAB)
when the
second one is released.
Otherwise, returns Some(ClickA)
if the first button was released or
Some(ClickB)
if the second button was released.
Otherwise returns None
.
Auto Trait Implementations
impl<A, B> Unpin for Monitor<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
impl<A, B> Send for Monitor<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for Monitor<A, B> where
A: Sync,
B: Sync,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self