Struct arti_client::status::BootstrapStatus
source · [−]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
sourceimpl BootstrapStatus
impl BootstrapStatus
sourcepub fn as_frac(&self) -> f32
pub fn as_frac(&self) -> f32
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.”
sourcepub fn ready_for_traffic(&self) -> bool
pub fn ready_for_traffic(&self) -> bool
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.
sourcepub fn blocked(&self) -> Option<Blockage>
pub fn blocked(&self) -> Option<Blockage>
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
sourceimpl Clone for BootstrapStatus
impl Clone for BootstrapStatus
sourcefn clone(&self) -> BootstrapStatus
fn clone(&self) -> BootstrapStatus
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BootstrapStatus
impl Debug for BootstrapStatus
sourceimpl Default for BootstrapStatus
impl Default for BootstrapStatus
sourcefn default() -> BootstrapStatus
fn default() -> BootstrapStatus
Returns the “default value” for a type. Read more
sourceimpl Display for BootstrapStatus
impl Display for BootstrapStatus
sourcefn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
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
impl RefUnwindSafe for BootstrapStatus
impl Send for BootstrapStatus
impl Sync for BootstrapStatus
impl Unpin for BootstrapStatus
impl UnwindSafe for BootstrapStatus
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
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