#[non_exhaustive]pub enum VfError {
Op {
index: usize,
err_no: u32,
domain: ErrorDomain,
operation: Option<&'static str>,
path: Option<PathBuf>,
},
Transport {
index: Option<usize>,
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: ErrorDomainTransport
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 unsupported(index: usize) -> VfError
Sourcepub fn index(&self) -> usize
👎Deprecated: use index_opt(); an unknown transport location is not request zero
pub fn index(&self) -> usize
use index_opt(); an unknown transport location is not request zero
The operation index this error refers to (best-effort for transport failures; 0 when unknown).
Sourcepub fn index_opt(&self) -> Option<usize>
pub fn index_opt(&self) -> Option<usize>
The operation index as an Option; None only for a transport
failure that cannot be attributed to any operation.
Sourcepub fn err_no(&self) -> u32
pub fn err_no(&self) -> u32
The filesystem status code, or VF_ERR_RPC for transport failures.
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 from_rpc(e: RpcError, index: impl Into<Option<usize>>) -> VfError
pub fn from_rpc(e: RpcError, index: impl Into<Option<usize>>) -> VfError
Convert a low-level RpcError into a VfError, attributing the
failure to index in the caller’s operation array. index is the
caller’s operation index, which may differ from the compound-internal
op index; for transport failures the index is best-effort. The
transport message (if any) is preserved.
Sourcepub fn from_rpc_indexed(e: RpcError) -> VfError
pub fn from_rpc_indexed(e: RpcError) -> VfError
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 failed_item_certainty(&self) -> OutcomeCertainty
pub fn failed_item_certainty(&self) -> OutcomeCertainty
Completion certainty for the failed item in a vector operation.
This deliberately says nothing about earlier items in the same vector: VFSI is ordered but non-transactional, so a successful prefix may already have changed filesystem state.
Sourcepub fn failed_item_retry_class(&self) -> RetryClass
pub fn failed_item_retry_class(&self) -> RetryClass
Retry guidance for the failed item, not for the entire vector call. Retrying a whole mutation vector can repeat its completed prefix.
Sourcepub fn certainty(&self) -> OutcomeCertainty
👎Deprecated since 0.2.0: this describes only the failed item; use failed_item_certainty
pub fn certainty(&self) -> OutcomeCertainty
this describes only the failed item; use failed_item_certainty
Deprecated ambiguous spelling; use Self::failed_item_certainty.
Sourcepub fn retry_class(&self) -> RetryClass
👎Deprecated since 0.2.0: this describes only the failed item; use failed_item_retry_class
pub fn retry_class(&self) -> RetryClass
this describes only the failed item; use failed_item_retry_class
Deprecated ambiguous spelling; use Self::failed_item_retry_class.
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()