#[non_exhaustive]pub enum Error {
Show 30 variants
InvalidDeviceId(u8),
BankOutOfRange(u8),
BankLetter(char),
ProgramOutOfRange(u8),
EmptyRun {
first: u8,
last: u8,
},
PatternOutOfRange(u8),
ChannelOutOfRange(u8),
ParameterOutOfRange(u8),
EngineOutOfRange(u8),
ValueOutOfRange {
parameter: u8,
value: u16,
max: u16,
},
UnsupportedProtocolVersion(u8),
ProgramLength {
expected: usize,
found: usize,
},
NotAProgramDump(u8),
ProgramNameTooLong(usize),
ProgramNameCharacter(char),
Unframed,
ShortFrame(usize),
Foreign {
manufacturer: [u8; 3],
model: u8,
},
UnknownCommand(u8),
PayloadLength {
command: u8,
expected: usize,
found: usize,
},
PackedRunLength(usize),
NotSevenBit(u8),
BufferTooSmall {
needed: usize,
available: usize,
},
SysExTooLong(usize),
SysExInterrupted,
InvalidInterface(u8),
NotAnInquiryRequest,
NotAnInquiryResponse,
ProgramNotKnown,
QueueFull {
needed: usize,
available: usize,
},
}Expand description
Everything that can go wrong while parsing or building DeepMind messages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidDeviceId(u8)
A device ID byte was neither 0..=15 nor 0x7F.
BankOutOfRange(u8)
A bank index was 8 or greater.
BankLetter(char)
A bank letter was outside A..=H.
ProgramOutOfRange(u8)
A program number was 128 or greater.
EmptyRun
A run of programs ended before it started.
Fields
PatternOutOfRange(u8)
A user pattern number was 32 or greater.
ChannelOutOfRange(u8)
A MIDI channel was 16 or greater.
ParameterOutOfRange(u8)
A parameter offset was 242 or greater, so it names no parameter.
EngineOutOfRange(u8)
An effect engine number was outside the four the synthesizer has.
ValueOutOfRange
A value was outside the range its parameter accepts.
Fields
UnsupportedProtocolVersion(u8)
A dump carried a comms protocol version this build does not understand.
ProgramLength
Program data was not as long as its comms protocol version calls for.
Fields
NotAProgramDump(u8)
A message that carries no program was read as one.
ProgramNameTooLong(usize)
A program name was longer than sixteen characters.
ProgramNameCharacter(char)
A program name held a character the display has no glyph for.
Unframed
A SysEx frame did not start with F0 or did not end with F7.
ShortFrame(usize)
A SysEx frame was too short to carry the header every message has.
Foreign
A SysEx frame carried another manufacturer’s or another model’s ID.
Fields
UnknownCommand(u8)
A command byte no documented message uses.
PayloadLength
A payload was not the length its command requires.
Fields
PackedRunLength(usize)
A packed run ended in a high-bit byte with no data bytes to apply it to.
NotSevenBit(u8)
A byte meant for the inside of a SysEx frame had its high bit set.
BufferTooSmall
An output buffer was too small for what had to be written into it.
SysExTooLong(usize)
A SysEx frame was longer than the decoder’s buffer, and was dropped.
SysExInterrupted
A status byte arrived before a SysEx frame’s F7, ending it early.
InvalidInterface(u8)
An interface byte was neither MIDI (0), USB (1) nor Wi-Fi (2).
NotAnInquiryRequest
A universal SysEx frame was not a device inquiry request.
NotAnInquiryResponse
A universal SysEx frame was not a DeepMind device inquiry response.
ProgramNotKnown
An edit was made before any program was known, so nothing said what changed.
QueueFull
More was queued to send than the outbound queue had room for.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()