Enum tor_circmgr::Error
source · [−]#[non_exhaustive]
pub enum Error {
Show 19 variants
GuardNotUsable,
PendingCanceled,
PendingFailed(Box<Error>),
LostUsabilityRace(RestrictionFailed),
CircCanceled,
UsageMismatched(RestrictionFailed),
CircTimeout,
RequestTimeout,
NoPath(String),
NoExit(String),
GuardMgr(GuardMgrError),
Guard(PickGuardError),
RequestFailed(RetryError<Box<Error>>),
Channel {
peer: OwnedChanTarget,
cause: Error,
},
Protocol {
peer: Option<OwnedChanTarget>,
error: Error,
},
ExpiredConsensus,
Spawn {
spawning: &'static str,
cause: Arc<SpawnError>,
},
State(Error),
Bug(Bug),
}
Expand description
An error returned while looking up or building a circuit
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
GuardNotUsable
We started building a circuit on a guard, but later decided not to use that guard.
PendingCanceled
We were waiting on a pending circuit, but it failed to report
PendingFailed(Box<Error>)
We were waiting on a pending circuits, but it failed.
LostUsabilityRace(RestrictionFailed)
We were told that we could use a given circuit, but before we got a chance to try it, its usage changed so that we had no longer find it suitable.
This is a version of UsageMismatched
for when a race is the
likeliest explanation for the mismatch.
CircCanceled
A circuit succeeded, but was cancelled before it could be used.
Circuits can be cancelled either by a call to
retire_all_circuits()
, or by a configuration change that
makes old paths unusable.
UsageMismatched(RestrictionFailed)
We were told that we could use a circuit, but when we tried, we found that its usage did not support what we wanted.
This can happen due to a race when a number of tasks all decide that they can use the same pending circuit at once: one of them will restrict the circuit, and the others will get this error.
See LostUsabilityRace
.
CircTimeout
A circuit build took too long to finish.
RequestTimeout
A request spent too long waiting for a circuit
NoPath(String)
No suitable relays for a request
NoExit(String)
No suitable exit relay for a request.
GuardMgr(GuardMgrError)
Problem creating or updating a guard manager.
Guard(PickGuardError)
Problem selecting a guard relay.
RequestFailed(RetryError<Box<Error>>)
Unable to get or build a circuit, despite retrying.
Channel
Problem with channel
Protocol
Fields
peer: Option<OwnedChanTarget>
The peer that created the protocol error.
This is set to None if we can’t blame a single party.
error: Error
The underlying error.
Protocol issue while building a circuit.
ExpiredConsensus
We have an expired consensus
Spawn
Fields
spawning: &'static str
What we were trying to spawn
cause: Arc<SpawnError>
What happened when we tried to spawn it.
Unable to spawn task
State(Error)
Problem loading or storing persistent state.
Bug(Bug)
An error caused by a programming issue . or a failure in another library that we can’t work around.
Implementations
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()
sourceimpl From<GuardMgrError> for Error
impl From<GuardMgrError> for Error
sourcefn from(err: GuardMgrError) -> Error
fn from(err: GuardMgrError) -> Error
Converts to this type from the input type.
sourceimpl From<PickGuardError> for Error
impl From<PickGuardError> for Error
sourcefn from(source: PickGuardError) -> Self
fn from(source: PickGuardError) -> Self
Converts to this type from the input type.
sourceimpl From<TimeoutError> for Error
impl From<TimeoutError> for Error
sourcefn from(_: TimeoutError) -> Error
fn from(_: TimeoutError) -> Error
Converts to this type from the input type.
sourceimpl HasRetryTime for Error
impl HasRetryTime for Error
sourcefn retry_time(&self) -> RetryTime
fn retry_time(&self) -> RetryTime
Return the time when the operation that gave this error can be retried. Read more
sourcefn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime where
F: FnOnce() -> Duration,
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime where
F: FnOnce() -> Duration,
Return an absolute retry when the operation that gave this error can be retried. Read more
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> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert 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
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
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