pub enum Error {
Show 18 variants
Config {
message: String,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Processing {
operation: String,
message: String,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Model {
model_type: String,
message: String,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Audio {
message: String,
audio_info: Option<Box<AudioErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Realtime {
message: String,
performance_context: Option<Box<PerformanceErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Streaming {
message: String,
stream_info: Option<Box<StreamErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Buffer {
message: String,
buffer_info: Option<Box<BufferErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Transform {
transform_type: String,
message: String,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Validation {
message: String,
field: Option<String>,
expected: Option<String>,
actual: Option<String>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Runtime {
message: String,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
MemorySafety {
message: String,
safety_info: Option<Box<MemorySafetyErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
ThreadSafety {
message: String,
thread_info: Option<Box<ThreadSafetyErrorInfo>>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
ResourceExhaustion {
resource_type: String,
current_usage: Option<u64>,
limit: Option<u64>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Timeout {
operation: String,
timeout_ms: u64,
elapsed_ms: Option<u64>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Compatibility {
message: String,
required_version: Option<String>,
current_version: Option<String>,
context: Option<Box<ErrorContext>>,
recovery_suggestions: Box<Vec<String>>,
},
Io(Error),
Serialization(Error),
Candle(Error),
}Expand description
Error types for voice conversion
Variants§
Config
Configuration error with detailed context
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Processing
Processing error with operation context
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Model
Model error with model type information
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Audio
Audio error with audio format details
Fields
audio_info: Option<Box<AudioErrorInfo>>Information about the audio that caused the error
context: Option<Box<ErrorContext>>Additional context about the error
Realtime
Real-time processing error with performance context
Fields
performance_context: Option<Box<PerformanceErrorInfo>>Performance context when the error occurred
context: Option<Box<ErrorContext>>Additional context about the error
Streaming
Streaming error with stream state
Fields
stream_info: Option<Box<StreamErrorInfo>>Information about the stream that caused the error
context: Option<Box<ErrorContext>>Additional context about the error
Buffer
Buffer error with buffer details
Fields
buffer_info: Option<Box<BufferErrorInfo>>Information about the buffer that caused the error
context: Option<Box<ErrorContext>>Additional context about the error
Transform
Transform error with transform type
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Validation
Validation error with field information
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Runtime
Runtime error with execution context
Fields
context: Option<Box<ErrorContext>>Additional context about the error
MemorySafety
Memory safety error
Fields
safety_info: Option<Box<MemorySafetyErrorInfo>>Information about the memory safety violation
context: Option<Box<ErrorContext>>Additional context about the error
ThreadSafety
Thread safety error
Fields
thread_info: Option<Box<ThreadSafetyErrorInfo>>Information about the thread safety violation
context: Option<Box<ErrorContext>>Additional context about the error
ResourceExhaustion
Resource exhaustion error
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Timeout
Timeout error
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Compatibility
Compatibility error
Fields
context: Option<Box<ErrorContext>>Additional context about the error
Io(Error)
I/O error with enhanced context
Serialization(Error)
Serialization error with enhanced context
Candle(Error)
Candle ML framework error
Implementations§
Source§impl Error
impl Error
Sourcepub fn config(message: String) -> Self
pub fn config(message: String) -> Self
Create a simple configuration error (backwards compatibility)
Sourcepub fn config_with_context(message: String, context: ErrorContext) -> Self
pub fn config_with_context(message: String, context: ErrorContext) -> Self
Create a configuration error with context
Sourcepub fn processing(message: String) -> Self
pub fn processing(message: String) -> Self
Create a simple processing error (backwards compatibility)
Sourcepub fn realtime(message: String) -> Self
pub fn realtime(message: String) -> Self
Create a simple realtime error (backwards compatibility)
Sourcepub fn streaming(message: String) -> Self
pub fn streaming(message: String) -> Self
Create a simple streaming error (backwards compatibility)
Sourcepub fn transform(message: String) -> Self
pub fn transform(message: String) -> Self
Create a simple transform error (backwards compatibility)
Sourcepub fn validation(message: String) -> Self
pub fn validation(message: String) -> Self
Create a simple validation error (backwards compatibility)
Sourcepub fn runtime(message: String) -> Self
pub fn runtime(message: String) -> Self
Create a simple runtime error (backwards compatibility)
Sourcepub fn processing_with_context(
operation: String,
message: String,
context: ErrorContext,
) -> Self
pub fn processing_with_context( operation: String, message: String, context: ErrorContext, ) -> Self
Create a processing error with context
Sourcepub fn validation_detailed(
message: String,
field: Option<String>,
expected: Option<String>,
actual: Option<String>,
) -> Self
pub fn validation_detailed( message: String, field: Option<String>, expected: Option<String>, actual: Option<String>, ) -> Self
Create a validation error with detailed information
Sourcepub fn audio_with_info(message: String, audio_info: AudioErrorInfo) -> Self
pub fn audio_with_info(message: String, audio_info: AudioErrorInfo) -> Self
Create an audio error with audio information
Sourcepub fn realtime_with_performance(
message: String,
performance_context: PerformanceErrorInfo,
) -> Self
pub fn realtime_with_performance( message: String, performance_context: PerformanceErrorInfo, ) -> Self
Create a real-time error with performance context
Sourcepub fn memory_safety_with_info(
message: String,
safety_info: MemorySafetyErrorInfo,
) -> Self
pub fn memory_safety_with_info( message: String, safety_info: MemorySafetyErrorInfo, ) -> Self
Create a memory safety error with detailed information
Sourcepub fn thread_safety_with_info(
message: String,
thread_info: ThreadSafetyErrorInfo,
) -> Self
pub fn thread_safety_with_info( message: String, thread_info: ThreadSafetyErrorInfo, ) -> Self
Create a thread safety error with thread information
Sourcepub fn recovery_suggestions(&self) -> &[String]
pub fn recovery_suggestions(&self) -> &[String]
Get recovery suggestions for this error
Sourcepub fn context(&self) -> Option<&ErrorContext>
pub fn context(&self) -> Option<&ErrorContext>
Get error context if available
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more