#[non_exhaustive]pub enum VfError {
Op {
index: usize,
err_no: u32,
domain: ErrorDomain,
operation: Option<&'static str>,
path: Option<PathBuf>,
},
OpUnattributed {
err_no: u32,
domain: ErrorDomain,
operation: Option<&'static str>,
path: Option<PathBuf>,
},
Transport {
index: Option<usize>,
kind: TransportKind,
message: String,
operation: Option<&'static str>,
path: Option<PathBuf>,
},
}Expand description
The failure of one operation in a vectorized call.
Either a filesystem status failure attributable to a specific operation index, or a transport / client-side failure (where the index is optional because some failures cannot be attributed to one request). An indexed failure does not roll back an already-completed prefix, and a transport failure can make the outcome of an in-flight mutation ambiguous.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Op
A filesystem status failure; err_no is errno-style or an NFS4ERR
code, mirroring the C tc_res struct.
Fields
domain: ErrorDomainOpUnattributed
A filesystem / protocol status that cannot be attributed to a specific
operation index (for example a compound-level failure with no per-op
result). Unlike Op, it does not pretend the failure is
operation 0. index reports None.
Transport
A transport / client-side failure with a human-readable message; there
is no filesystem status (err_no reports
VF_ERR_RPC). index is None when the failure cannot be
attributed to any operation.
Implementations§
Source§impl VfError
impl VfError
pub fn failure(index: usize, err_no: u32) -> VfError
pub fn client(index: usize, code: u32) -> VfError
Sourcepub fn transport(
index: impl Into<Option<usize>>,
message: impl Into<String>,
) -> VfError
pub fn transport( index: impl Into<Option<usize>>, message: impl Into<String>, ) -> VfError
A transport / client-side failure. index is best-effort; pass None
when the failure cannot be attributed to a specific operation.
pub fn transport_with_kind( index: impl Into<Option<usize>>, kind: TransportKind, message: impl Into<String>, ) -> VfError
pub fn unsupported(index: usize) -> VfError
Sourcepub fn index(&self) -> Option<usize>
pub fn index(&self) -> Option<usize>
Logical request index, or None when a failure cannot be attributed.
An index is not a completion boundary: this item can itself contain
completed chunks, and other requests can already have changed state.
Sourcepub fn err_no(&self) -> u32
pub fn err_no(&self) -> u32
Raw compatibility code: errno, NFS status, SMB status, or VF_ERR_RPC.
Application code should use kind or typed
status, not compare this value to errno constants.
Sourcepub fn is_transport(&self) -> bool
pub fn is_transport(&self) -> bool
Whether this is a transport / client-side failure (no filesystem status).
Sourcepub fn transport_kind(&self) -> Option<TransportKind>
pub fn transport_kind(&self) -> Option<TransportKind>
Transport provenance only; this never authorizes mutation replay.
Sourcepub fn with_index(self, index: usize) -> VfError
pub fn with_index(self, index: usize) -> VfError
Re-attribute this error to a different operation index.
Sourcepub fn map_index(self, map: impl FnOnce(usize) -> usize) -> VfError
pub fn map_index(self, map: impl FnOnce(usize) -> usize) -> VfError
Transform a known request index while preserving an unattributable
transport failure as None.
Sourcepub fn with_context(
self,
operation: &'static str,
path: impl Into<PathBuf>,
) -> VfError
pub fn with_context( self, operation: &'static str, path: impl Into<PathBuf>, ) -> VfError
Attach operation and path context without string parsing.
pub fn domain(&self) -> ErrorDomain
pub fn status(&self) -> Option<StatusCode>
pub fn operation(&self) -> Option<&'static str>
pub fn path(&self) -> Option<&Path>
Source§impl VfError
impl VfError
Sourcepub fn kind(&self) -> ErrorKind
pub fn kind(&self) -> ErrorKind
Portable category; Self::status retains the original status.
This is deliberately not retry guidance. Even a semantic failure can follow successful chunks of the same logical mutation. Reconcile state before replaying a mutation unless its idempotence is established.
Trait Implementations§
impl Eq for VfError
Source§impl Error for VfError
impl Error for VfError
1.30.0 · 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()