pub struct InputDeviceHandlerPolling<Message> { /* private fields */ }
Expand description

A handler for a Launchpad input connection that can be polled for new messages. The actual polling methods are implemented inside MsgPollingWrapper. Look there for documentation on how to poll messages.

Trait Implementations§

source§

impl<Message> MsgPollingWrapper for InputDeviceHandlerPolling<Message>

§

type Message = Message

The type of message that is yielded
source§

fn receiver(&self) -> &Receiver<Self::Message>

Returns a std::sync::mpsc::Receiver that yields messages, where the type of messages is described by the associated Self::Message type
source§

fn recv(&self) -> Self::Message

Wait for a message to arrive, and return that. For a non-block variant, see Self::try_recv.
source§

fn try_recv(&self) -> Option<Self::Message>

If there is a pending message, return that. Otherwise, return None. Read more
source§

fn recv_timeout(&self, timeout: Duration) -> Option<Self::Message>

Receives a single message. If no message arrives within the timespan specified by timeout, None is returned.
source§

fn iter(&self) -> Iter<'_, Self::Message>

Returns an iterator over all arriving messages. The iterator will only return when the MIDI connection has been dropped. Read more
source§

fn iter_pending(&self) -> TryIter<'_, Self::Message>

Returns an iterator over the currently pending messages. As soon as all pending messages have been iterated over, the iterator will return. Read more
source§

fn iter_for(&self, duration: Duration) -> IterFor<'_, Self::Message>

Returns an iterator that yields all arriving messages for a specified amount of time. After the specified duration has passed, the iterator will stop and not yield any more messages. Read more
source§

fn iter_for_millis(&self, millis: u64) -> IterFor<'_, Self::Message>

Returns an iterator that yields all arriving messages for a specified amount of time. After the specified duration has passed, the iterator will stop and not yield any more messages. Read more
source§

fn drain(&self) -> usize

Drain of any pending messages. This is useful on Launchpad startup - the Launchpad has the weird property that any button inputs while disconnected queue up and will all be released at the same time as soon as someone connects to it. In most cases you don’t want to deal with those stale messages though - in those cases, call drain() after establishing the connection. Read more

Auto Trait Implementations§

§

impl<Message> !RefUnwindSafe for InputDeviceHandlerPolling<Message>

§

impl<Message> Send for InputDeviceHandlerPolling<Message>where Message: Send,

§

impl<Message> !Sync for InputDeviceHandlerPolling<Message>

§

impl<Message> Unpin for InputDeviceHandlerPolling<Message>

§

impl<Message> !UnwindSafe for InputDeviceHandlerPolling<Message>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.