pub struct MidiInput(_);
Expand description

Pointer to a MIDI input device.

Implementations

Returns the list of MIDI events which are currently in the buffer.

This must only be called in the real-time audio thread! See get_midi_input().

Design

In the past this function was unsafe and expected a closure which let the consumer do something with the event list. All of that is not necessary anymore since we ensure in get_midi_input() that we only ever publish valid MidiInput instances, and those only by a very short-lived reference that’s not possible to cache anywhere. That makes it possible to bind the lifetime of the event list to the one of the MidiInput and everything is fine!

Returning an owned event list would be wasteful because we would need to copy all events first. That would be especially bad because this code is supposed to run in the audio thread and therefore has real-time requirements.

Trait Implementations

Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.