pub trait InputDevice {
type Message;
const MIDI_CONNECTION_NAME: &'static str;
const MIDI_DEVICE_KEYWORD: &'static str;
// Required method
fn decode_message(timestamp: u64, data: &[u8]) -> Self::Message;
// Provided methods
fn from_port<F>(
midi_input: MidiInput,
port: &MidiInputPort,
user_callback: F,
) -> Result<InputDeviceHandler, MidiError>
where F: FnMut(Self::Message) + Send + 'static { ... }
fn from_port_polling(
midi_input: MidiInput,
port: &MidiInputPort,
) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
where Self::Message: Send + 'static { ... }
fn guess<F>(user_callback: F) -> Result<InputDeviceHandler, MidiError>
where F: FnMut(Self::Message) + Send + 'static { ... }
fn guess_polling( ) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
where Self::Message: Send + 'static { ... }
}Required Associated Constants§
const MIDI_CONNECTION_NAME: &'static str
const MIDI_DEVICE_KEYWORD: &'static str
Required Associated Types§
Required Methods§
fn decode_message(timestamp: u64, data: &[u8]) -> Self::Message
Provided Methods§
fn from_port<F>( midi_input: MidiInput, port: &MidiInputPort, user_callback: F, ) -> Result<InputDeviceHandler, MidiError>
fn from_port_polling( midi_input: MidiInput, port: &MidiInputPort, ) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
Sourcefn guess<F>(user_callback: F) -> Result<InputDeviceHandler, MidiError>
fn guess<F>(user_callback: F) -> Result<InputDeviceHandler, MidiError>
Search the midi devices and choose the first midi device matching the wanted Launchpad type.
Sourcefn guess_polling() -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
fn guess_polling() -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
Search the midi devices and choose the first midi device matching the wanted Launchpad type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.