pub enum IoCause {
Transient,
Permanent,
}Expand description
Why an I/O failure is or is not worth another attempt.
Retryability is a property of the operating-system cause, never of the call
site: ENOSPC on the cache directory clears when the operator frees space,
and EACCES on the same path does not. Classifying once, where the
std::io::Error is still in hand, is what stops the envelope from
promising an agent a retry that can only ever fail.
Variants§
Transient
The condition can clear without the caller changing anything.
Permanent
The condition needs operator action; retrying repeats the failure.
Implementations§
Source§impl IoCause
impl IoCause
Sourcepub fn of(err: &Error) -> Self
pub fn of(err: &Error) -> Self
Classify an OS error by whether waiting could plausibly help.
Unknown kinds classify as Self::Permanent. An agent that stops early
on a transient fault wastes one run; an agent that retries a permanent
one spins until its budget is gone, so the safe default is to stop.
Trait Implementations§
impl Copy for IoCause
impl Eq for IoCause
impl StructuralPartialEq for IoCause
Auto Trait Implementations§
impl Freeze for IoCause
impl RefUnwindSafe for IoCause
impl Send for IoCause
impl Sync for IoCause
impl Unpin for IoCause
impl UnsafeUnpin for IoCause
impl UnwindSafe for IoCause
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.