Skip to main content

ClientError

Enum ClientError 

Source
#[non_exhaustive]
pub enum ClientError {
Show 23 variants Resolve { addr: String, }, Socket(Error), SocketOption { operation: &'static str, remote: SocketAddr, source: Error, }, ReadTimeoutRestore { source: Error, }, Protocol(ProtoError), OpenTimeout, OpenTimeoutTooSmall { timeout: Duration, minimum: Duration, }, NoOpenTimeouts, ServerRejected, UnexpectedNoTestReply, NonZeroNoTestToken { token: u64, }, ProtocolVersionMismatch { requested: i64, received: i64, }, ZeroToken, NegotiationRejected { reason: String, }, NotOpen, AlreadyOpen, AlreadyCompleted, AlreadyClosed, DurationOverflow, CounterOverflow { counter: &'static str, }, PendingLimitExceeded { limit: usize, }, InvalidConfig { reason: String, }, WorkerPanicked,
}
Expand description

Failure reported while configuring, opening, running, receiving, closing, or joining an IRTT client session.

Configuration validation errors usually require changing ClientConfig or related options before retrying. Network, protocol, and runtime errors may be transient, but can also reflect peer incompatibility or an invalid session state.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Resolve

The configured server address could not be resolved to a socket address.

Check the host, port, address-family restrictions, and name service configuration before retrying.

Fields

§addr: String
§

Socket(Error)

A UDP socket operation failed while binding, connecting, sending, or receiving.

This can be a transient network or OS error, but may also reflect local permissions, routing, or socket configuration.

§

SocketOption

Applying or reading a socket option failed.

This is usually caused by an unsupported option, an invalid local value, or a platform-specific socket limitation. Changing socket configuration is more likely to help than retrying unchanged.

Fields

§operation: &'static str
§remote: SocketAddr
§source: Error
§

ReadTimeoutRestore

Restoring the configured read timeout after open negotiation failed.

The session may have opened successfully, but the socket could not be returned to the caller’s requested receive-timeout behavior.

Fields

§source: Error
§

Protocol(ProtoError)

A packet failed IRTT protocol parsing or authentication.

Likely causes include malformed input, unsupported protocol data, or an HMAC mismatch between client and server.

§

OpenTimeout

No valid open reply was received before all configured open attempts timed out.

Retrying can succeed when the server or network is temporarily unavailable. Persistent failures usually require changing the address, authentication key, server configuration, or timeout settings.

§

OpenTimeoutTooSmall

An open-attempt timeout is below the client’s supported minimum.

Increase the configured timeout before retrying.

Fields

§timeout: Duration
§minimum: Duration
§

NoOpenTimeouts

The configured open-attempt timeout list is empty.

Provide at least one timeout before opening the session.

§

ServerRejected

The server explicitly rejected the open request.

Retrying unchanged is unlikely to help unless the server configuration or load has changed.

§

UnexpectedNoTestReply

A no-test open request received a reply that did not have no-test close semantics.

This indicates an incompatible or unexpected peer response.

§

NonZeroNoTestToken

A no-test open reply included a connection token.

No-test negotiation must not establish a probe session, so a non-zero token indicates an incompatible or unexpected peer response.

Fields

§token: u64
§

ProtocolVersionMismatch

The peer replied with a protocol version different from the requested version.

This is a protocol compatibility error and requires compatible client and server versions.

Fields

§requested: i64
§received: i64
§

ZeroToken

The server returned a zero connection token for a normal test session.

A normal session requires a non-zero token to correlate echo traffic, so this indicates an invalid peer response.

§

NegotiationRejected

Negotiated parameters were rejected by the configured negotiation policy.

Use a less restrictive configuration or NegotiationPolicy::Loose when the caller accepts documented server restrictions.

Fields

§reason: String
§

NotOpen

The requested operation requires an open session, but the client is only connected.

§

AlreadyOpen

The session is already open.

Continue running, receiving, or closing the existing session instead of opening it again.

§

AlreadyCompleted

The no-test session has already completed.

Create a new client session to perform another negotiation.

§

AlreadyClosed

The session is already closed.

Create a new client session before opening or running another test.

§

DurationOverflow

A duration could not be represented as nanoseconds for scheduling or protocol encoding.

Use smaller configured or negotiated durations.

§

CounterOverflow

A client-maintained counter would overflow.

This is a runtime limit rather than a network failure. Start a new session if the test duration or send volume reaches this limit.

Fields

§counter: &'static str
§

PendingLimitExceeded

Sending another probe would exceed the configured pending-probe limit.

Increase ClientConfig::max_pending_probes, reduce send rate, or receive replies and timeouts more often before sending again.

Fields

§limit: usize
§

InvalidConfig

Client configuration failed validation before the requested operation.

The reported reason names a value that must be changed before retrying.

Fields

§reason: String
§

WorkerPanicked

A managed-session worker thread panicked before producing an outcome.

This is a runtime failure from joining the managed session, not a protocol response from the server.

Trait Implementations§

Source§

impl Debug for ClientError

Source§

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

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

impl Display for ClientError

Source§

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

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

impl Error for ClientError

Source§

fn source(&self) -> Option<&(dyn Error + '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 ClientError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ProtoError> for ClientError

Source§

fn from(source: ProtoError) -> Self

Converts to this type from the input type.

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> Same for T

Source§

type Output = T

Should always be Self
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.