pub enum CodecError {
Show 21 variants
InvalidConfig {
details: String,
},
UnsupportedCodec {
codec_type: String,
},
InvalidFormat {
details: String,
},
InvalidFrameSize {
expected: usize,
actual: usize,
},
InvalidSampleRate {
rate: u32,
supported: Vec<u32>,
},
InvalidChannelCount {
channels: u8,
supported: Vec<u8>,
},
InvalidBitrate {
bitrate: u32,
min: u32,
max: u32,
},
EncodingFailed {
reason: String,
},
DecodingFailed {
reason: String,
},
BufferTooSmall {
needed: usize,
actual: usize,
},
BufferOverflow {
size: usize,
capacity: usize,
},
InitializationFailed {
reason: String,
},
ResetFailed {
reason: String,
},
InvalidPayload {
details: String,
},
CodecNotFound {
name: String,
},
FeatureNotEnabled {
feature: String,
},
SimdFailed {
reason: String,
},
MathError {
operation: String,
reason: String,
},
IoError {
reason: String,
},
ExternalLibraryError {
library: String,
error: String,
},
InternalError {
message: String,
},
}Expand description
Comprehensive error type for codec operations
Variants§
InvalidConfig
Invalid codec configuration
UnsupportedCodec
Unsupported codec type
InvalidFormat
Invalid audio format
InvalidFrameSize
Invalid frame size
InvalidSampleRate
Invalid sample rate
InvalidChannelCount
Invalid channel count
InvalidBitrate
Invalid bitrate
EncodingFailed
Encoding operation failed
DecodingFailed
Decoding operation failed
BufferTooSmall
Buffer too small for operation
BufferOverflow
Buffer overflow during operation
InitializationFailed
Codec initialization failed
ResetFailed
Codec reset failed
InvalidPayload
Invalid payload data
CodecNotFound
Codec not found
FeatureNotEnabled
Feature not enabled
SimdFailed
SIMD operation failed
MathError
Math operation failed (overflow, underflow, etc.)
IoError
I/O operation failed
ExternalLibraryError
External library error
InternalError
Internal error (should not occur in normal operation)
Implementations§
Source§impl CodecError
impl CodecError
Sourcepub fn invalid_config(details: impl Into<String>) -> Self
pub fn invalid_config(details: impl Into<String>) -> Self
Create a new invalid configuration error
Sourcepub fn unsupported_codec(codec_type: impl Into<String>) -> Self
pub fn unsupported_codec(codec_type: impl Into<String>) -> Self
Create a new unsupported codec error
Sourcepub fn invalid_format(details: impl Into<String>) -> Self
pub fn invalid_format(details: impl Into<String>) -> Self
Create a new invalid format error
Sourcepub fn encoding_failed(reason: impl Into<String>) -> Self
pub fn encoding_failed(reason: impl Into<String>) -> Self
Create a new encoding failed error
Sourcepub fn decoding_failed(reason: impl Into<String>) -> Self
pub fn decoding_failed(reason: impl Into<String>) -> Self
Create a new decoding failed error
Sourcepub fn initialization_failed(reason: impl Into<String>) -> Self
pub fn initialization_failed(reason: impl Into<String>) -> Self
Create a new initialization failed error
Sourcepub fn feature_not_enabled(feature: impl Into<String>) -> Self
pub fn feature_not_enabled(feature: impl Into<String>) -> Self
Create a new feature not enabled error
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Create a new internal error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Get the error category
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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
Source§impl From<&str> for CodecError
impl From<&str> for CodecError
Source§impl From<Error> for CodecError
Convert from I/O errors
impl From<Error> for CodecError
Convert from I/O errors
Source§impl From<ParseFloatError> for CodecError
Convert from parsing errors
impl From<ParseFloatError> for CodecError
Convert from parsing errors
Source§fn from(error: ParseFloatError) -> Self
fn from(error: ParseFloatError) -> Self
Source§impl From<ParseIntError> for CodecError
Convert from parsing errors
impl From<ParseIntError> for CodecError
Convert from parsing errors