#[non_exhaustive]
pub enum Error {
Show 25 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,
},
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),
}
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
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
An error occurred while trying to decode or parse a cell.
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.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more