pub struct RpcError {
pub op_index: usize,
pub status: u32,
pub message: String,
pub transport_kind: Option<TransportKind>,
}Expand description
An error from the low-level client: either an NFS4ERR_* status reported by the server for a compound operation, or a transport/RPC-level failure.
Callers can inspect status directly instead of
parsing error strings.
op_index is the index of the failing operation in the caller’s request
slice: the batched compound helpers (vread_native, vwrite_native, getattr_many,
…) translate compound positions to caller-relative indices before
returning. For single-operation helpers it is the position within the
compound (typically 2: SEQUENCE, PUTFH, op). Transport failures always
report op_index == 0.
Fields§
§op_index: usizeIndex of the failing operation within the compound.
status: u32The failing op’s NFS4ERR_* status, or STATUS_TRANSPORT.
message: StringHuman-readable context.
transport_kind: Option<TransportKind>Present only for transport/RPC failures.
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub fn op(op_index: usize, status: u32) -> RpcError
pub fn op(op_index: usize, status: u32) -> RpcError
An NFS status from a specific compound operation.
Sourcepub fn transport(message: impl Into<String>) -> RpcError
pub fn transport(message: impl Into<String>) -> RpcError
A transport / RPC-level failure (no NFS status available).
pub fn transport_with_kind( kind: TransportKind, message: impl Into<String>, ) -> RpcError
Sourcepub fn from_io(error: Error) -> RpcError
pub fn from_io(error: Error) -> RpcError
Preserve classification at an I/O boundary without inspecting its text.
Sourcepub fn is_transport(&self) -> bool
pub fn is_transport(&self) -> bool
Whether this is a transport failure rather than an NFS status.
Sourcepub fn with_op_index(self, index: usize) -> RpcError
pub fn with_op_index(self, index: usize) -> RpcError
Re-attribute this error to a different operation index (used by the batched helpers to translate compound positions to caller indices).
Trait Implementations§
impl Eq for RpcError
Source§impl Error for RpcError
impl Error for RpcError
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()