#[non_exhaustive]
pub enum Error {
Show 23 variants
BytesErr(Error),
ChanIoErr(Arc<Error>),
HandshakeIoErr(Arc<Error>),
CellErr(Error),
InvalidOutputLength,
NoSuchHop,
BadCellAuth,
BadCircHandshake,
HandshakeProto(String),
HandshakeCertsExpired {
expired_by: Duration,
},
ChanProto(String),
CircProto(String),
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(Error)
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.
CellErr(Error)
An error occurred in the cell-handling layer.
InvalidOutputLength
We tried to produce too much output for some 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.
BadCircHandshake
A circuit-extension handshake failed.
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
Channel is closed.
CircuitClosed
Circuit is closed.
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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