1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use core::fmt;
#[cfg(feature = "std")]
use std::error;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum FromBytesError {
ChannelOutOfRange,
NoBytes,
NoSysExEndByte,
NotEnoughBytes,
UnexpectedEndSysExByte,
UnexpectedNonSysExEndByte(u8),
UnexpectedDataByte,
UnexpectedStatusByte,
NoteOutOfRange,
DataByteOutOfRange,
U14OutOfRange,
}
#[cfg(feature = "std")]
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,
}
#[cfg(feature = "std")]
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"),
}
}
}