Enum tor_circmgr::Error

source ·
#[non_exhaustive]
pub enum Error {
Show 18 variants GuardNotUsable, PendingCanceled, PendingFailed(Box<Error>), LostUsabilityRace(RestrictionFailed), CircCanceled, UsageMismatched(RestrictionFailed), CircTimeout, RequestTimeout, NoPath { role: &'static str, can_share: FilterCount, correct_usage: FilterCount, }, NoExit { can_share: FilterCount, correct_ports: FilterCount, }, GuardMgr(GuardMgrError), Guard(PickGuardError), RequestFailed(RetryError<Box<Error>>), Channel { peer: LoggedChanTarget, cause: Error, }, Protocol { action: &'static str, peer: Option<LoggedChanTarget>, error: Error, }, 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

Fields

§role: &'static str

The role that we were trying to choose a relay for.

§can_share: FilterCount

Relays accepted and rejected based on relay family policies.

§correct_usage: FilterCount

Relays accepted and rejected based on our usage requirements.

No suitable relays for a request

§

NoExit

Fields

§can_share: FilterCount

Exit relays accepted and rejected based on relay family policies.

§correct_ports: FilterCount

Exit relays accepted and rejected base on the ports that we need.

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: LoggedChanTarget

Which relay we were trying to connect to

§cause: Error

What went wrong

Problem with channel

§

Protocol

Fields

§action: &'static str

The action that we were trying to take.

§peer: Option<LoggedChanTarget>

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.

§

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
👎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
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
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.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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