Struct tor_guardmgr::GuardMonitor
source · [−]pub struct GuardMonitor { /* private fields */ }
Expand description
An object used to tell the GuardMgr
about the result of
trying to build a circuit through a guard.
The GuardMgr
needs to know about these statuses, so that it can tell
whether the guard is running or not.
Implementations
sourceimpl GuardMonitor
impl GuardMonitor
sourcepub fn succeeded(self)
pub fn succeeded(self)
Report that a circuit was successfully built in a way that indicates that the guard is working.
Note that this doesn’t necessarily mean that the circuit succeeded. For example, we might decide that extending to a second hop means that a guard is usable, even if the circuit stalled at the third hop.
sourcepub fn failed(self)
pub fn failed(self)
Report that the circuit could not be built successfully, in a way that indicates that the guard isn’t working.
(This either be because of a network failure, a timeout, or something else.)
sourcepub fn attempt_abandoned(self)
pub fn attempt_abandoned(self)
Report that we did not try to build a circuit using the guard, or that we can’t tell whether the guard is working.
Dropping a GuardMonitor
is without calling succeeded
or
failed
or pending_status
is equivalent to calling this
function.
sourcepub fn pending_status(&mut self, status: GuardStatus)
pub fn pending_status(&mut self, status: GuardStatus)
Configure this monitor so that, if it is dropped before use,
it sends the status status
.
sourcepub fn skew(&mut self, skew: ClockSkew)
pub fn skew(&mut self, skew: ClockSkew)
Set the given clock skew value to be reported to the guard manager.
Clock skew can be reported on success or failure, but it should only be reported if the first hop is actually authenticated.
sourcepub fn inspect_pending_status(&self) -> (GuardStatus, bool)
pub fn inspect_pending_status(&self) -> (GuardStatus, bool)
Return the current pending status and “ignore indeterminate” status for this guard monitor.
sourcepub fn ignore_indeterminate_status(&mut self)
pub fn ignore_indeterminate_status(&mut self)
Configure this monitor to ignore any indeterminate status values, and treat them as abandoned attempts.
We should use this whenever the path being built with this guard is not randomly generated.
sourcepub fn report(self, msg: GuardStatus)
pub fn report(self, msg: GuardStatus)
Report a message for this guard.
Trait Implementations
sourceimpl Debug for GuardMonitor
impl Debug for GuardMonitor
Auto Trait Implementations
impl !RefUnwindSafe for GuardMonitor
impl Send for GuardMonitor
impl Sync for GuardMonitor
impl Unpin for GuardMonitor
impl !UnwindSafe for GuardMonitor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
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> 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