[−][src]Struct twilight_gateway::shard::Latency
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
Auto Trait Implementations
impl RefUnwindSafe for Latency
impl Send for Latency
impl Sync for Latency
impl Unpin for Latency
impl UnwindSafe for Latency
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,