#[non_exhaustive]pub enum VfError {
Op {
index: usize,
err_no: u32,
},
Transport {
index: Option<usize>,
message: String,
},
}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 best-effort: backends report 0 when the failure cannot be attributed).
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.
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
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
pub fn index(&self) -> usize
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
Like from_rpc, but trusts e.op_index as the
caller-relative operation index. The batched client helpers translate
compound positions to caller indices before returning, so batched
backend calls can use this directly.
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.
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()