Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 21 variants Runtime(String), InvalidAddress(String), InvalidEndpointPath, InvalidFingerprint(String), AlreadyRegistered, NotConnected, ConnectionLost(LossCause), Negotiation(String), Protocol(String), Rejected, UnknownEndpoint, Unsupported, NoParkedConnection, NoReply, Canceled, Indeterminate, LimitExceeded, Tls(String), Untrusted(Fingerprint), Io(Error), Transport(String),
}
Expand description

Everything that can go wrong in a weida operation.

The variants are deliberately outcome-shaped rather than cause-shaped: an application must distinguish ConnectionLost (definitely not delivered) from Indeterminate (may or may not have been delivered) because the two permit different retry decisions. See docs/FAILURE_MODEL.md.

Variants§

§

Runtime(String)

The runtime could not be created or used (e.g. no ambient reactor).

§

InvalidAddress(String)

A weida:// URL could not be parsed.

§

InvalidEndpointPath

An endpoint path violated the addressing rules.

§

InvalidFingerprint(String)

A fingerprint’s text form was not sha256: plus 64 hex digits.

§

AlreadyRegistered

An endpoint path is already registered on this listener.

§

NotConnected

The endpoint has no usable peer connection.

§

ConnectionLost(LossCause)

The connection was lost before the local transfer reached FIN; the payload was definitely not delivered. The LossCause says why, which is what an application deciding whether to redial needs.

§

Negotiation(String)

Version/capability negotiation failed.

§

Protocol(String)

The peer violated the wire protocol.

§

Rejected

The peer refused the transfer (STOP_SENDING(REJECTED) or ERROR{REJECTED}).

§

UnknownEndpoint

The peer has no endpoint registered under the requested path.

§

Unsupported

The peer does not support a requested protocol feature.

§

NoParkedConnection

A stream toward the peer was needed and the peer had parked no connection for one. Only a local socket transport can produce this: an accepted socket cannot be dialled back, so fan-out rides the connections a subscriber parks (decisions/0012 §4.4). A publisher treats it as a drop of that copy, not as a failure of the subscription.

§

NoReply

The peer accepted the request but never opened a reply stream.

§

Canceled

The transfer was canceled, locally or by the peer.

§

Indeterminate

The connection was lost after the local FIN while awaiting an ACK or a reply: the outcome is genuinely unknown (master doc §22).

§

LimitExceeded

A local or negotiated resource limit was reached.

§

Tls(String)

TLS material could not be loaded or configured, or the handshake failed for a reason other than an untrusted peer.

§

Untrusted(Fingerprint)

The peer proved possession of a key whose fingerprint is neither pinned nor certified by a configured anchor. Carries what the peer presented, so an operator can pin it after checking it out of band.

§

Io(Error)

Underlying I/O failure.

§

Transport(String)

Transport-level failure that is not one of the modelled outcomes.

Implementations§

Source§

impl Error

Source

pub fn is_definite_failure(&self) -> bool

True if the error proves the transfer had no effect at the peer.

Indeterminate is deliberately not in this set: modelling it apart from definite failure is the point of master doc §22. Neither is NoReply — the request was accepted and may well have had an effect; only the answer is missing.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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 Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ErrorCode> for Error

Source§

fn from(code: ErrorCode) -> Error

Converts to this type from the input type.
Source§

impl From<StopReason> for Error

Source§

fn from(reason: StopReason) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.