Make all error enums Clone (#924)
This commit is contained in:
parent
f43d36e554
commit
ca77d848ad
3 changed files with 10 additions and 8 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- All error enums are now `Clone`.
|
||||||
|
|
||||||
# Version 0.15.3 (2024-03-04)
|
# Version 0.15.3 (2024-03-04)
|
||||||
|
|
||||||
- Add `try_with_sample_rate`, a non-panicking variant of `with_sample_rate`.
|
- Add `try_with_sample_rate`, a non-panicking variant of `with_sample_rate`.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Errors that might occur during `Asio::load_driver`.
|
/// Errors that might occur during `Asio::load_driver`.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum LoadDriverError {
|
pub enum LoadDriverError {
|
||||||
LoadDriverFailed,
|
LoadDriverFailed,
|
||||||
DriverAlreadyExists,
|
DriverAlreadyExists,
|
||||||
|
|
@ -10,7 +10,7 @@ pub enum LoadDriverError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// General errors returned by ASIO.
|
/// General errors returned by ASIO.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum AsioError {
|
pub enum AsioError {
|
||||||
NoDrivers,
|
NoDrivers,
|
||||||
HardwareMalfunction,
|
HardwareMalfunction,
|
||||||
|
|
|
||||||
12
src/error.rs
12
src/error.rs
|
|
@ -89,7 +89,7 @@ impl From<BackendSpecificError> for DeviceNameError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Error that can happen when enumerating the list of supported formats.
|
/// Error that can happen when enumerating the list of supported formats.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum SupportedStreamConfigsError {
|
pub enum SupportedStreamConfigsError {
|
||||||
/// The device no longer exists. This can happen if the device is disconnected while the
|
/// The device no longer exists. This can happen if the device is disconnected while the
|
||||||
/// program is running.
|
/// program is running.
|
||||||
|
|
@ -119,7 +119,7 @@ impl From<BackendSpecificError> for SupportedStreamConfigsError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// May occur when attempting to request the default input or output stream format from a [`Device`](crate::Device).
|
/// May occur when attempting to request the default input or output stream format from a [`Device`](crate::Device).
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum DefaultStreamConfigError {
|
pub enum DefaultStreamConfigError {
|
||||||
/// The device no longer exists. This can happen if the device is disconnected while the
|
/// The device no longer exists. This can happen if the device is disconnected while the
|
||||||
/// program is running.
|
/// program is running.
|
||||||
|
|
@ -152,7 +152,7 @@ impl From<BackendSpecificError> for DefaultStreamConfigError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Error that can happen when creating a [`Stream`](crate::Stream).
|
/// Error that can happen when creating a [`Stream`](crate::Stream).
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum BuildStreamError {
|
pub enum BuildStreamError {
|
||||||
/// The device no longer exists. This can happen if the device is disconnected while the
|
/// The device no longer exists. This can happen if the device is disconnected while the
|
||||||
/// program is running.
|
/// program is running.
|
||||||
|
|
@ -203,7 +203,7 @@ impl From<BackendSpecificError> for BuildStreamError {
|
||||||
/// As of writing this, only macOS may immediately return an error while calling this method. This
|
/// As of writing this, only macOS may immediately return an error while calling this method. This
|
||||||
/// is because both the alsa and wasapi backends only enqueue these commands and do not process
|
/// is because both the alsa and wasapi backends only enqueue these commands and do not process
|
||||||
/// them immediately.
|
/// them immediately.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum PlayStreamError {
|
pub enum PlayStreamError {
|
||||||
/// The device associated with the stream is no longer available.
|
/// The device associated with the stream is no longer available.
|
||||||
DeviceNotAvailable,
|
DeviceNotAvailable,
|
||||||
|
|
@ -235,7 +235,7 @@ impl From<BackendSpecificError> for PlayStreamError {
|
||||||
/// As of writing this, only macOS may immediately return an error while calling this method. This
|
/// As of writing this, only macOS may immediately return an error while calling this method. This
|
||||||
/// is because both the alsa and wasapi backends only enqueue these commands and do not process
|
/// is because both the alsa and wasapi backends only enqueue these commands and do not process
|
||||||
/// them immediately.
|
/// them immediately.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum PauseStreamError {
|
pub enum PauseStreamError {
|
||||||
/// The device associated with the stream is no longer available.
|
/// The device associated with the stream is no longer available.
|
||||||
DeviceNotAvailable,
|
DeviceNotAvailable,
|
||||||
|
|
@ -263,7 +263,7 @@ impl From<BackendSpecificError> for PauseStreamError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors that might occur while a stream is running.
|
/// Errors that might occur while a stream is running.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum StreamError {
|
pub enum StreamError {
|
||||||
/// The device no longer exists. This can happen if the device is disconnected while the
|
/// The device no longer exists. This can happen if the device is disconnected while the
|
||||||
/// program is running.
|
/// program is running.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue