#[non_exhaustive]pub enum CoreError {
Signal(SignalError),
Inference(InferenceError),
Storage(StorageError),
Configuration {
message: String,
},
Validation {
message: String,
},
NotFound {
resource_type: &'static str,
id: String,
},
Timeout {
operation: String,
duration_ms: u64,
},
InvalidState {
expected: String,
actual: String,
},
Internal {
message: String,
},
}Expand description
Top-level error type for the WiFi-DensePose system.
This enum encompasses all possible errors that can occur within the core system, providing a unified error type for the entire crate.
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.
Signal(SignalError)
Signal processing error
Inference(InferenceError)
Neural network inference error
Storage(StorageError)
Data storage error
Configuration
Configuration error
Validation
Validation error for input data
NotFound
Resource not found
Fields
Timeout
Operation timed out
Fields
InvalidState
Invalid state for the requested operation
Internal
Internal error (should not happen in normal operation)
Implementations§
Source§impl CoreError
impl CoreError
Sourcepub fn configuration(message: impl Into<String>) -> Self
pub fn configuration(message: impl Into<String>) -> Self
Creates a new configuration error.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Creates a new validation error.
Sourcepub fn not_found(resource_type: &'static str, id: impl Into<String>) -> Self
pub fn not_found(resource_type: &'static str, id: impl Into<String>) -> Self
Creates a new not found error.
Sourcepub fn timeout(operation: impl Into<String>, duration_ms: u64) -> Self
pub fn timeout(operation: impl Into<String>, duration_ms: u64) -> Self
Creates a new timeout error.
Sourcepub fn invalid_state(
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn invalid_state( expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Creates a new invalid state error.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Returns true if this error is recoverable.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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 From<InferenceError> for CoreError
impl From<InferenceError> for CoreError
Source§fn from(source: InferenceError) -> Self
fn from(source: InferenceError) -> Self
Converts to this type from the input type.
Source§impl From<SignalError> for CoreError
impl From<SignalError> for CoreError
Source§fn from(source: SignalError) -> Self
fn from(source: SignalError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for CoreError
impl From<StorageError> for CoreError
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CoreError
impl RefUnwindSafe for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl UnsafeUnpin for CoreError
impl UnwindSafe for CoreError
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