#[non_exhaustive]
pub enum Error {
Show 27 variants BytesErr { object: &'static str, err: Error, }, ChanIoErr(Arc<Error>), HandshakeIoErr(Arc<Error>), CellEncodeErr { object: &'static str, err: Error, }, CellDecodeErr { object: &'static str, err: Error, }, EncodeErr { object: &'static str, err: EncodeError, }, HandshakeCertErr(CertError), InvalidKDFOutputLength, NoSuchHop, BadCellAuth, BadCircHandshakeAuth, HandshakeProto(String), HandshakeCertsExpired { expired_by: Duration, }, ChanProto(String), CircProto(String), ChannelClosed(ChannelClosed), CircuitClosed, IdRangeFull, CircRefused(&'static str), BadStreamAddress, EndReceived(EndReason), NotConnected, StreamProto(String), ChanMismatch(String), Bug(Bug), ResolveError(ResolveError), MissingId(RelayIdType),
}
Expand description

An error type for the tor-proto crate.

This type should probably be split into several. There’s more than one kind of error that can occur while doing something with the Tor protocol.

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.

BytesErr

Fields

object: &'static str

What we were trying to parse.

err: Error

The error that occurred while parsing it.

An error that occurred in the tor_bytes crate while decoding an object.

ChanIoErr(Arc<Error>)

An error that occurred from the io system when using a channel.

HandshakeIoErr(Arc<Error>)

An error from the io system that occurred when trying to connect a channel.

CellEncodeErr

Fields

object: &'static str

The object we were trying to create or encode.

err: Error

The error that occurred.

An error occurred while trying to create or encode a cell.

CellDecodeErr

Fields

object: &'static str

The object we were trying to decode.

err: Error

The error that occurred.

An error occurred while trying to decode or parse a cell.

EncodeErr

Fields

object: &'static str

What we were trying to create or encode.

err: EncodeError

The error that occurred.

An error occurred while trying to create or encode some non-cell message.

This is likely the result of a bug: either in this crate, or the code that provided the input.

HandshakeCertErr(CertError)

We found a problem with one of the certificates in the channel handshake.

InvalidKDFOutputLength

We tried to produce too much output for a key derivation function.

NoSuchHop

We tried to encrypt a message to a hop that wasn’t there.

BadCellAuth

The authentication information on this cell was completely wrong, or the cell was corrupted.

BadCircHandshakeAuth

A circuit-extension handshake failed due to a mismatched authentication value.

HandshakeProto(String)

Handshake protocol violation.

HandshakeCertsExpired

Fields

expired_by: Duration

For how long has the circuit been expired?

Handshake broken, maybe due to clock skew.

(If the problem can’t be due to clock skew, we return HandshakeProto instead.)

ChanProto(String)

Protocol violation at the channel level, other than at the handshake stage.

CircProto(String)

Protocol violation at the circuit level

ChannelClosed(ChannelClosed)

Channel is closed, or became closed while we were trying to do some operation.

CircuitClosed

Circuit is closed, or became closed while we were trying to so some operation.

IdRangeFull

Can’t allocate any more circuit or stream IDs on a channel.

CircRefused(&'static str)

Couldn’t extend a circuit because the extending relay or the target relay refused our request.

BadStreamAddress

Tried to make or use a stream to an invalid destination address.

EndReceived(EndReason)

Received an End cell from the other end of a stream.

NotConnected

Stream was already closed when we tried to use it.

StreamProto(String)

Stream protocol violation

ChanMismatch(String)

Channel does not match target

Bug(Bug)

There was a programming error somewhere in our code, or the calling code.

ResolveError(ResolveError)

Remote DNS lookup failed.

MissingId(RelayIdType)

We tried to do something with a that we couldn’t, because of an identity key type that the relay doesn’t have.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Return the kind of this error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more