#[non_exhaustive]pub enum RefusalCause {
SubmitNeeded,
DrainNeeded,
SubmitAndDrainNeeded,
Busy,
UnknownTarget,
Unsupported,
Invalid,
Unusable(IoFault),
Unknown(IoFault),
}Expand description
Why a backend refused a submission (DI-D-52), so the caller can take the action that clears it without probing. New causes may be added.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SubmitNeeded
The submission queue is full: submitting what is queued makes room.
DrainNeeded
No more results fit in the completion queue: popping completions makes room.
SubmitAndDrainNeeded
Both: submit what is queued, and pop completions.
Busy
Another submission is under way; retry once it returns.
UnknownTarget
No target is attached under the submission’s key.
Unsupported
The backend cannot perform what is asked at all – a registered region on a backend with no registered buffers, for one. Retrying does not help.
Invalid
The submission is malformed for its target or the backend: an offset, length or buffer the target’s geometry does not admit, or a region outside its registered buffer. Retrying does not help.
Unusable(IoFault)
The backend can take no more submissions, ever; carries what it reported.
Unknown(IoFault)
The backend could not say why; carries what it reported.
Implementations§
Source§impl RefusalCause
impl RefusalCause
Sourcepub fn needs_submit(&self) -> bool
pub fn needs_submit(&self) -> bool
Whether submitting what is queued is part of clearing it.
Sourcepub fn needs_drain(&self) -> bool
pub fn needs_drain(&self) -> bool
Whether popping completions is part of clearing it.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the same submission may succeed if retried: after submitting or draining, as
needs_submit and needs_drain say, or once
another submission returns. An unknown cause may or may not clear; it answers false.
Trait Implementations§
Source§impl Clone for RefusalCause
impl Clone for RefusalCause
Source§fn clone(&self) -> RefusalCause
fn clone(&self) -> RefusalCause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RefusalCause
impl Debug for RefusalCause
Source§impl Display for RefusalCause
impl Display for RefusalCause
impl Eq for RefusalCause
Source§impl Error for RefusalCause
impl Error for RefusalCause
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()