Enum tor_dirclient::RequestError
source · #[non_exhaustive]
pub enum RequestError {
DirTimeout,
TruncatedHeaders,
ResponseTooLong(usize),
Utf8Encoding(FromUtf8Error),
IoError(Arc<Error>),
Proto(Error),
HttparseError(Error),
HttpError(Arc<Error>),
ContentEncoding(String),
TooMuchClockSkew,
EmptyRequest,
HttpStatus(u16),
}
Expand description
An error originating from the tor-dirclient crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DirTimeout
The directory cache took too long to reply to us.
TruncatedHeaders
We got an EOF before we were done with the headers.
ResponseTooLong(usize)
Received a response that was longer than we expected.
Utf8Encoding(FromUtf8Error)
Data received was not UTF-8 encoded.
IoError(Arc<Error>)
Io error while reading on connection
Proto(Error)
A protocol error while launching a stream
HttparseError(Error)
Error when parsing http
HttpError(Arc<Error>)
Error while creating http request
ContentEncoding(String)
Unrecognized content-encoding
TooMuchClockSkew
Too much clock skew between us and the directory.
(We’ve givin up on this request early, since any directory that it believes in, we would reject as untimely.)
EmptyRequest
We tried to launch a request without any requested objects.
This can happen if (for example) we request an empty list of microdescriptors or certificates.
HttpStatus(u16)
HTTP status code indicates a not completely successful request
Implementations§
source§impl RequestError
impl RequestError
sourcepub fn should_retire_circ(&self) -> bool
pub fn should_retire_circ(&self) -> bool
Return true if this error means that the circuit shouldn’t be used for any more directory requests.
Trait Implementations§
source§impl Clone for RequestError
impl Clone for RequestError
source§fn clone(&self) -> RequestError
fn clone(&self) -> RequestError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RequestError
impl Debug for RequestError
source§impl Display for RequestError
impl Display for RequestError
source§impl Error for RequestError
impl Error for RequestError
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
source§impl From<Error> for RequestError
impl From<Error> for RequestError
source§impl From<Error> for RequestError
impl From<Error> for RequestError
source§impl From<Error> for RequestError
impl From<Error> for RequestError
source§impl From<Error> for RequestError
impl From<Error> for RequestError
source§impl From<FromUtf8Error> for RequestError
impl From<FromUtf8Error> for RequestError
source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
source§impl From<TimeoutError> for RequestError
impl From<TimeoutError> for RequestError
source§fn from(_: TimeoutError) -> Self
fn from(_: TimeoutError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for RequestError
impl Send for RequestError
impl Sync for RequestError
impl Unpin for RequestError
impl !UnwindSafe for RequestError
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more