1use macron::{ Display, From, Error };
2
3pub type StdResult<T, E> = std::result::Result<T, E>;
5pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>;
7
8#[derive(Debug, Display, Error, From)]
10pub enum Error {
11 #[from]
12 Io(std::io::Error),
13
14 #[display = "Failed to get the audio devices list"]
15 FoundNoDevices,
16
17 #[display = "Expected an audio device or microphone, found: '{0}'"]
18 ExpectedAudioDevice(String),
19
20 #[display = "Failed to set active device: '{0}'"]
21 FailedSetDefaultDevice(String),
22
23 #[display = "Failed to set volume to device: '{0}'"]
24 FailedSetVolume(String),
25
26 #[display = "Failed to switch device mute: '{0}'"]
27 FailedSwitchDeviceMute(String),
28}