[][src]Struct twilight_gateway::shard::Latency

pub struct Latency { /* fields omitted */ }

Information about the latency of a Shard's websocket connection.

This is obtained through Shard::info.

Implementations

impl Latency[src]

pub fn average(&self) -> Option<Duration>[src]

The average time it took to receive an acknowledgement for every heartbeat sent over the duration of the session.

For example, a reasonable value for this may be between 10 to 100 milliseconds depending on the network connection and physical location.

Note

If this is None, the shard has not received a heartbeat yet.

pub fn heartbeats(&self) -> u32[src]

The total number of heartbeats that have been sent during this session.

pub fn recent(&self) -> &VecDeque<Duration>[src]

The 5 most recent latency times.

Index 0 is the oldest, 4 is the most recent.

pub fn received(&self) -> Option<Instant>[src]

When the last heartbeat acknowledgement was received.

pub fn sent(&self) -> Option<Instant>[src]

When the last heartbeat was sent.

Trait Implementations

impl Clone for Latency[src]

impl Debug for Latency[src]

impl<'de> Deserialize<'de> for Latency[src]

impl Serialize for Latency[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,