Skip to main content

Error

Enum Error 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§first: u8

Program number the run was to start at.

§last: u8

Program number it was to end at, which was lower.

§

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

§parameter: u8

Offset of the parameter the value was meant for.

§value: u16

The value offered.

§max: u16

Highest value the parameter accepts. The lowest is always zero.

§

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

§expected: usize

Bytes the version’s program data occupies.

§found: usize

Bytes that were offered.

§

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

§manufacturer: [u8; 3]

The three manufacturer ID bytes the frame carried.

§model: u8

The model ID byte the frame carried.

§

UnknownCommand(u8)

A command byte no documented message uses.

§

PayloadLength

A payload was not the length its command requires.

Fields

§command: u8

Command byte of the message being parsed.

§expected: usize

Payload length the command calls for.

§found: usize

Payload length the frame actually carried.

§

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.

Fields

§needed: usize

Bytes the operation needed.

§available: usize

Bytes the caller supplied.

§

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.

Fields

§needed: usize

Items the operation needed room for.

§available: usize

Items the queue had room for.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Error

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Error

Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<E> From<Error> for Error<E>

Available on crate feature transport only.
Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl Hash for Error

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.