pub enum NfsError {
Show 17 variants
Io(Error),
Nfs3(ErrorCode),
Nfs4(Nfs4ErrorCode),
LockDenied {
lock_type: u32,
offset: u64,
length: u64,
owner: Bytes,
},
Mount(MountErrorCode),
Rpc(String),
Xdr(String),
Unsupported(String),
InvalidInput(String),
ClosedResource(String),
ModeViolation(String),
ClientClosed(String),
PositionUncertain(String),
LostOpenState(String),
FileClose(Vec<FileCloseFailure>),
RdattrError(u32),
OperationOutcome(Box<OperationOutcomeError>),
}Expand description
Structured error type for NFS operations.
Replaces the previous std::io::Error + ErrorKind::Other pattern,
preserving NFS protocol error codes for programmatic matching.
Variants§
Io(Error)
Underlying I/O or network error.
Nfs3(ErrorCode)
NFS3 protocol error (nfsstat3).
Nfs4(Nfs4ErrorCode)
NFS4 protocol error (nfsstat4).
LockDenied
NFSv4 byte-range lock conflict, including the server-reported range.
Mount(MountErrorCode)
MOUNT protocol error (mount_mountstat3).
Rpc(String)
RPC-level error (rejected, mismatch, truncated response).
Xdr(String)
XDR encoding/decoding error.
Unsupported(String)
Operation not supported by this NFS version.
InvalidInput(String)
Invalid input (bad URL, bad parameters).
ClosedResource(String)
A local operation targeted a resource that is already closed.
ModeViolation(String)
The open mode does not permit the requested operation.
ClientClosed(String)
The connected client is already closing or closed.
PositionUncertain(String)
A prior uncertain mutation made the next relative position unknowable.
LostOpenState(String)
Recovery could not prove that an open resource retained identity and state.
FileClose(Vec<FileCloseFailure>)
Ordered failures observed while flushing and closing one open file.
RdattrError(u32)
Server returned rdattr_error for an entry (READDIRPLUS per-entry error).
OperationOutcome(Box<OperationOutcomeError>)
An operation failed without an authoritative result and carries retry guidance.
Implementations§
Source§impl NfsError
impl NfsError
Sourcepub fn request_transmission(&self) -> Option<RequestTransmission>
pub fn request_transmission(&self) -> Option<RequestTransmission>
Returns transport send-boundary evidence when it is available.
Sourcepub fn before_send_failure(
operation_class: OperationClass,
context: RequestContext,
completed_bytes: Option<u64>,
source: NfsError,
) -> Self
pub fn before_send_failure( operation_class: OperationClass, context: RequestContext, completed_bytes: Option<u64>, source: NfsError, ) -> Self
Wraps a failure for which the caller proved that the current request did not cross the transport send boundary.
Sourcepub fn operation_outcome(&self) -> Option<&OperationOutcomeError>
pub fn operation_outcome(&self) -> Option<&OperationOutcomeError>
Returns structured retry/verification guidance when the result is non-authoritative.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
目标不存在(NFS3ERR_NOENT / NFS4ERR_NOENT,errno 2)
Trait Implementations§
Source§impl Error for NfsError
impl Error for NfsError
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()