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
//! Error types for rill-io
use thiserror::Error;
/// I/O errors
#[derive(Error, Debug)]
pub enum IoError {
/// Backend-specific error
#[error("Backend error: {0}")]
Backend(String),
/// Device not found
#[error("Device not found: {0}")]
DeviceNotFound(String),
/// Configuration error
#[error("Configuration error: {0}")]
Config(String),
/// Stream error
#[error("Stream error: {0}")]
Stream(String),
/// Initialization error
#[error("Initialization error: {0}")]
Init(String),
/// Unsupported feature
#[error("Unsupported feature: {0}")]
Unsupported(String),
/// Operation timed out
#[error("Timeout")]
Timeout,
/// Wrapped `std::io::Error`
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// Channel communication error
#[error("Channel error")]
Channel,
/// MIDI protocol or device error
#[error("MIDI error: {0}")]
Midi(String),
}
/// Result of I/O operations
pub type IoResult<T> = Result<T, IoError>;