#[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
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.

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

Fields

peer: OwnedChanTarget

Which relay we were trying to connect to

cause: Error

What went wrong

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

Return a list of the peers to “blame” for this error, if there are any.

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

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. 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

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Return the kind of this error.

Return the time when the operation that gave this error can be retried. Read more

Return an absolute retry when the operation that gave this error can be retried. Read more

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

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

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. 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.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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