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
impl Error
Sourcepub fn is_definite_failure(&self) -> bool
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 Error for Error
impl Error for Error
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()