1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum IoError {
8 #[error("Backend error: {0}")]
10 Backend(String),
11
12 #[error("Device not found: {0}")]
14 DeviceNotFound(String),
15
16 #[error("Configuration error: {0}")]
18 Config(String),
19
20 #[error("Stream error: {0}")]
22 Stream(String),
23
24 #[error("Initialization error: {0}")]
26 Init(String),
27
28 #[error("Unsupported feature: {0}")]
30 Unsupported(String),
31
32 #[error("Timeout")]
34 Timeout,
35
36 #[error("IO error: {0}")]
38 Io(#[from] std::io::Error),
39
40 #[error("Channel error")]
42 Channel,
43}
44
45pub type IoResult<T> = Result<T, IoError>;