pub struct Context { /* private fields */ }Expand description
Contains metrics about the underlying connection
Passed to the Resolver, with each call to disconnect.
Currently tracks the number of reconnect attempts, but in the future may be expanded to include additional metrics.
Implementations§
Source§impl Context
impl Context
Sourcepub fn total_reconnect_attempts(&self) -> usize
pub fn total_reconnect_attempts(&self) -> usize
The total number of times a reconnect has been attempted.
The first time Resolver::disconnected is invoked this will return 1.
Sourcepub fn current_reconnect_attempts(&self) -> usize
pub fn current_reconnect_attempts(&self) -> usize
The number of reconnect attempts since the last successful connection. Reset each time the connection is re-established
Trait Implementations§
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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
Mutably borrows from an owned value. Read more