#[non_exhaustive]pub enum Error {
InvalidConfig {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
BackendUnavailable {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Submission {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Completion {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
ResourceExhausted {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Unsupported {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Canceled {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Timeout {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Validation {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
ProcessState {
message: Cow<'static, str>,
fix: Cow<'static, str>,
},
Io {
message: Cow<'static, str>,
source: Error,
fix: Cow<'static, str>,
},
}Expand description
Errors produced by ring setup, submission, and completion handling.
use wireshift::Error;
let err = Error::invalid_config("queue_depth must be non-zero");
assert!(err.to_string().contains("Fix:"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig
The supplied configuration is invalid.
The selected backend is unavailable.
Submission
Submission could not be accepted.
Completion
Completion routing failed internally.
ResourceExhausted
Resource exhaustion was hit.
Unsupported
The caller attempted an unsupported operation.
Canceled
A cancellation request succeeded.
Timeout
The operation timed out.
Validation
Input validation failed.
ProcessState
The current process state is incompatible with the backend.
Io
A wrapped I/O error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_config(message: impl Into<Cow<'static, str>>) -> Self
pub fn invalid_config(message: impl Into<Cow<'static, str>>) -> Self
Creates an invalid configuration error with a standard fix hint.
Sourcepub fn io(
message: impl Into<Cow<'static, str>>,
source: Error,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn io( message: impl Into<Cow<'static, str>>, source: Error, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates an I/O-flavoured error.
Sourcepub fn validation(
message: impl Into<Cow<'static, str>>,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn validation( message: impl Into<Cow<'static, str>>, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates a validation error.
Sourcepub fn submission(
message: impl Into<Cow<'static, str>>,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn submission( message: impl Into<Cow<'static, str>>, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates a submission error.
Sourcepub fn completion(
message: impl Into<Cow<'static, str>>,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn completion( message: impl Into<Cow<'static, str>>, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates a completion error.
Sourcepub fn resource_exhausted(
message: impl Into<Cow<'static, str>>,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn resource_exhausted( message: impl Into<Cow<'static, str>>, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates a resource exhaustion error.
Creates a backend unavailable error.
Sourcepub fn canceled(
message: impl Into<Cow<'static, str>>,
fix: impl Into<Cow<'static, str>>,
) -> Self
pub fn canceled( message: impl Into<Cow<'static, str>>, fix: impl Into<Cow<'static, str>>, ) -> Self
Creates a cancellation error.
Sourcepub fn unsupported(message: impl Into<Cow<'static, str>>) -> Self
pub fn unsupported(message: impl Into<Cow<'static, str>>) -> Self
Creates an unsupported-operation error.
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
use the Display impl or to_string()