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, correct_country: 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.

§correct_country: FilterCount

Exit relays accepted and rejected based on exit country code.

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§

source§

impl Error

source

pub fn peers(&self) -> Vec<&OwnedChanTarget>

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

Trait Implementations§

source§

impl AsRef<dyn Error> for Box<Error>

source§

fn as_ref(&self) -> &(dyn Error + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<dyn Error> for Error

source§

fn as_ref(&self) -> &(dyn Error + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Bug> for Error

source§

fn from(source: Bug) -> Self

Converts to this type from the input type.
source§

impl From<Canceled> for Error

source§

fn from(_: Canceled) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<GuardMgrError> for Error

source§

fn from(err: GuardMgrError) -> Error

Converts to this type from the input type.
source§

impl From<PickGuardError> for Error

source§

fn from(source: PickGuardError) -> Self

Converts to this type from the input type.
source§

impl From<TimeoutError> for Error

source§

fn from(_: TimeoutError) -> Error

Converts to this type from the input type.
source§

impl HasKind for Error

source§

fn kind(&self) -> ErrorKind

Return the kind of this error.
source§

impl HasRetryTime for Error

source§

fn retry_time(&self) -> RetryTime

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

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

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.
source§

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.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<E> ErrorReport for E
where E: Error + 'static,

source§

fn report(&self) -> Report<ReportHelper<'_>>

Return an object that displays the error and its causes
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more