#[non_exhaustive]pub enum AudioError {
DeviceNotFound(String),
DeviceInUse(String),
UnsupportedFormat {
requested: String,
supported: Vec<String>,
},
UnsupportedSampleRate {
requested: u32,
supported: Vec<u32>,
},
BufferOverflow {
samples_lost: usize,
},
BufferUnderrun {
silence_inserted: usize,
},
InvalidState {
current: String,
required: String,
},
VolumeOutOfRange(String),
CodecError(String),
PlatformError(String),
}Expand description
Audio subsystem errors.
Tier: T2-P (Σ Sum — all audio failure modes)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DeviceNotFound(String)
Device not found by ID.
DeviceInUse(String)
Device is already in use.
UnsupportedFormat
Unsupported sample format.
UnsupportedSampleRate
Unsupported sample rate.
BufferOverflow
Buffer overflow — producer is faster than consumer.
BufferUnderrun
Buffer underrun — consumer is faster than producer.
InvalidState
Stream is not in correct state for this operation.
VolumeOutOfRange(String)
Volume out of range [0.0, 1.0].
CodecError(String)
Codec error.
PlatformError(String)
Platform/driver error.
Trait Implementations§
Source§impl Clone for AudioError
impl Clone for AudioError
Source§fn clone(&self) -> AudioError
fn clone(&self) -> AudioError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioError
impl Debug for AudioError
Source§impl<'de> Deserialize<'de> for AudioError
impl<'de> Deserialize<'de> for AudioError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AudioError
impl Display for AudioError
Source§impl Error for AudioError
impl Error for AudioError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for AudioError
impl PartialEq for AudioError
Source§impl Serialize for AudioError
impl Serialize for AudioError
impl Eq for AudioError
impl StructuralPartialEq for AudioError
Auto Trait Implementations§
impl Freeze for AudioError
impl RefUnwindSafe for AudioError
impl Send for AudioError
impl Sync for AudioError
impl Unpin for AudioError
impl UnsafeUnpin for AudioError
impl UnwindSafe for AudioError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more