use core::error;
use core::fmt;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum FromBytesError {
ChannelOutOfRange,
NoBytes,
NoSysExEndByte,
NotEnoughBytes,
UnexpectedEndSysExByte,
UnexpectedNonSysExEndByte(u8),
UnexpectedDataByte,
UnexpectedStatusByte,
NoteOutOfRange,
DataByteOutOfRange,
U14OutOfRange,
}
impl error::Error for FromBytesError {}
impl fmt::Display for FromBytesError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(self, f)
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ToSliceError {
BufferTooSmall,
}
impl error::Error for ToSliceError {}
impl fmt::Display for ToSliceError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ToSliceError::BufferTooSmall => write!(f, "buffer size too small"),
}
}
}