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§
source§impl 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§
source§impl Clone for BootstrapStatus
impl Clone for BootstrapStatus
source§fn clone(&self) -> BootstrapStatus
fn clone(&self) -> BootstrapStatus
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BootstrapStatus
impl Debug for BootstrapStatus
source§impl Default for BootstrapStatus
impl Default for BootstrapStatus
source§fn default() -> BootstrapStatus
fn default() -> BootstrapStatus
source§impl Display for BootstrapStatus
impl Display for BootstrapStatus
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.