pub struct BootstrapStatus { /* private fields */ }
Expand description

Information about how ready a crate::TorClient is to handle requests.

Note that this status does not change monotonically: a TorClient can become more or less bootstrapped over time. (For example, a client can become less bootstrapped if it loses its internet connectivity, or if its directory information expires before it’s able to replace it.)

Implementations

Return a rough fraction (from 0.0 to 1.0) representing how far along the client’s bootstrapping efforts are.

0 is defined as “just started”; 1 is defined as “ready to use.”

Return true if the status indicates that the client is ready for traffic.

For the purposes of this function, the client is “ready for traffic” if, as far as we know, we can start acting on a new client request immediately.

If the client is unable to make forward progress for some reason, return that reason.

(Returns None if the client doesn’t seem to be stuck.)

Caveats

This function provides a “best effort” diagnostic: there will always be some blockage types that it can’t diagnose correctly. It may declare that Arti is stuck for reasons that are incorrect; or it may declare that the client is not stuck when in fact no progress is being made.

Therefore, the caller should always use a certain amount of modesty when reporting these values to the user. For example, it’s probably better to say “Arti says it’s stuck because it can’t make connections to the internet” rather than “You are not on the internet.”

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

Returns the “default value” for a type. Read more

Format this BootstrapStatus.

Note that the string returned by this function is designed for human readability, not for machine parsing. Other code should not depend on particular elements of this string.

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

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