#[non_exhaustive]pub enum ProcessingError {
MathematicalFailure {
operation: String,
reason: String,
},
AlgorithmFailure {
algorithm: String,
reason: String,
},
InsufficientData {
operation: String,
reason: String,
},
ConvergenceFailure {
algorithm: String,
iterations: u32,
},
ExternalDependency {
dependency: String,
operation: String,
reason: String,
},
}Expand description
Errors that occur during audio processing operations.
§Purpose
Covers failures in DSP algorithms, mathematical operations, and other processing-specific issues that don’t belong in the conversion, parameter, or layout domains.
§Intended Usage
Return these errors when a processing algorithm cannot complete successfully.
Use MathematicalFailure for
arithmetic issues, AlgorithmFailure
for general algorithm errors, and
ConvergenceFailure when an
iterative algorithm exhausts its iteration budget.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MathematicalFailure
A mathematical operation failed due to invalid input or numerical issues.
Fields
AlgorithmFailure
An audio processing algorithm encountered an error during execution.
Fields
InsufficientData
The operation failed due to insufficient data or resources.
Fields
ConvergenceFailure
A convergence-based algorithm failed to converge within limits.
Fields
ExternalDependency
An external dependency or resource required for processing is unavailable.
Implementations§
Source§impl ProcessingError
impl ProcessingError
Sourcepub fn algorithm_failure<A, R>(algorithm: A, reason: R) -> Self
pub fn algorithm_failure<A, R>(algorithm: A, reason: R) -> Self
Creates a ProcessingError::AlgorithmFailure error.
Use this when a DSP or signal-processing algorithm cannot complete successfully for reasons intrinsic to the algorithm itself, such as filter instability or a failed FFT plan.
§Arguments
algorithm— Name of the processing algorithm that failed.reason— Human-readable explanation of what went wrong.
§Returns
A ProcessingError::AlgorithmFailure variant.
§Examples
use audio_samples::ProcessingError;
let err = ProcessingError::algorithm_failure("butterworth", "filter became unstable");
assert!(matches!(err, ProcessingError::AlgorithmFailure { .. }));Trait Implementations§
Source§impl Clone for ProcessingError
impl Clone for ProcessingError
Source§fn clone(&self) -> ProcessingError
fn clone(&self) -> ProcessingError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessingError
impl Debug for ProcessingError
Source§impl Display for ProcessingError
impl Display for ProcessingError
Source§impl Error for ProcessingError
impl Error for ProcessingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<&str> for ProcessingError
impl From<&str> for ProcessingError
Source§impl From<ProcessingError> for AudioSampleError
impl From<ProcessingError> for AudioSampleError
Source§fn from(source: ProcessingError) -> Self
fn from(source: ProcessingError) -> Self
Auto Trait Implementations§
impl Freeze for ProcessingError
impl RefUnwindSafe for ProcessingError
impl Send for ProcessingError
impl Sync for ProcessingError
impl Unpin for ProcessingError
impl UnsafeUnpin for ProcessingError
impl UnwindSafe for ProcessingError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Src, Dst> ConvertTo<Dst> for Srcwhere
Dst: ConvertFrom<Src>,
impl<Src, Dst> ConvertTo<Dst> for Srcwhere
Dst: ConvertFrom<Src>,
Source§fn convert_to(self) -> Dst
fn convert_to(self) -> Dst
Dst using audio-aware scaling. Read more