pub struct Latency { /* private fields */ }
Expand description
Shard
’s gateway connection latency.
Measures the difference between sending a heartbeat and receiving an acknowledgement, also known as a heartbeat period. Spurious heartbeat acknowledgements are ignored.
May be obtained via Shard::latency
.
Implementations§
Source§impl Latency
impl Latency
Sourcepub const fn average(&self) -> Option<Duration>
pub const fn average(&self) -> Option<Duration>
Average latency.
For example, a reasonable value for this may be between 10 to 100 milliseconds depending on the network connection and physical location.
Returns None
if no heartbeat periods have been recorded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Latency
impl RefUnwindSafe for Latency
impl Send for Latency
impl Sync for Latency
impl Unpin for Latency
impl UnwindSafe for Latency
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