pub struct PingTracker { /* private fields */ }
Expand description
Tracks pings on a single relay connection.
Only the last ping needs is useful, any previously sent ping is forgotten and ignored.
Implementations§
Source§impl PingTracker
impl PingTracker
Sourcepub fn new(default_timeout: Duration) -> Self
pub fn new(default_timeout: Duration) -> Self
Creates a new ping tracker, setting the ping timeout for pings.
Sourcepub fn default_timeout(&self) -> Duration
pub fn default_timeout(&self) -> Duration
Returns the current timeout set for pings.
Sourcepub fn pong_received(&mut self, data: [u8; 8])
pub fn pong_received(&mut self, data: [u8; 8])
Updates the ping tracker with a received pong.
Only the pong of the most recent ping will do anything. There is no harm feeding any pong however.
Trait Implementations§
Source§impl Debug for PingTracker
impl Debug for PingTracker
Auto Trait Implementations§
impl Freeze for PingTracker
impl RefUnwindSafe for PingTracker
impl Send for PingTracker
impl Sync for PingTracker
impl Unpin for PingTracker
impl UnwindSafe for PingTracker
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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