Skip to main content

RpcError

Enum RpcError 

Source
pub enum RpcError {
Show 14 variants Io(Error), Xdr(Error), UnexpectedCall, Auth(auth_stat), RpcMismatch { low: u32, high: u32, }, WrongLength, UnexpectedXid, NotFullyParsed { buf: Vec<u8>, pos: u64, }, ProgUnavail, ProgMismatch { low: u32, high: u32, }, ProcUnavail, GarbageArgs, FragmentedReply, SystemErr,
}
Expand description

Error from an RPC call.

Covers I/O failures, XDR encoding/decoding issues, and RPC protocol errors. Returned by RpcClient::call and all Nfs3Client operations.

§Connection state after an error

Not every error leaves the underlying transport in the same state. Use is_connection_reusable to decide whether the connection can be kept.

Variants§

§

Io(Error)

An I/O error occurred during network communication.

§

Xdr(Error)

Failed to serialize or deserialize an XDR-encoded message.

§

UnexpectedCall

Received a CALL message when a REPLY was expected.

§

Auth(auth_stat)

Server rejected the request due to an authentication failure.

§

RpcMismatch

Server does not support the requested RPC version.

Fields

§low: u32

Lowest supported RPC version.

§high: u32

Highest supported RPC version.

§

WrongLength

The serialized RPC message length is not a multiple of 4 bytes.

§

UnexpectedXid

The reply XID does not match the request XID.

§

NotFullyParsed

The reply was not fully consumed after decoding.

Fields

§buf: Vec<u8>

Raw reply buffer.

§pos: u64

Cursor position where parsing stopped.

§

ProgUnavail

The requested program is not available on the server.

§

ProgMismatch

The requested program version is not supported.

Fields

§low: u32

Lowest supported program version.

§high: u32

Highest supported program version.

§

ProcUnavail

The requested procedure is not available.

§

GarbageArgs

The server could not decode the procedure arguments.

§

FragmentedReply

The server sent a fragmented reply, which is not supported.

Handling fragmented replies would require significant changes to the receive logic because subsequent fragments are not guaranteed to arrive immediately after the first one.

§

SystemErr

An unspecified server-side system error occurred.

Implementations§

Source§

impl RpcError

Source

pub const fn is_connection_reusable(&self) -> bool

Returns true if the connection that produced this error is still in a clean state and may be reused for the next call.

Returns false only for Io (transport is dead) and FragmentedReply (unread fragment data left in the socket).

All other errors — including Xdr, WrongLength, NotFullyParsed, and UnexpectedXid — are produced while operating on in-memory buffers after the full fragment has already been consumed from the wire, so the transport remains at a clean message boundary.

Trait Implementations§

Source§

impl Debug for RpcError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RpcError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RpcError

Source§

fn source(&self) -> Option<&(dyn StdError + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for RpcError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RpcError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<RpcError> for MountError

Source§

fn from(e: RpcError) -> Self

Converts to this type from the input type.
Source§

impl From<RpcError> for PortmapError

Source§

fn from(e: RpcError) -> Self

Converts to this type from the input type.
Source§

impl From<rejected_reply> for RpcError

Source§

fn from(e: rejected_reply) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<accept_stat_data> for RpcError

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: accept_stat_data) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.