[−][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
impl Clone for Latency
[src]
impl Debug for Latency
[src]
impl<'de> Deserialize<'de> for Latency
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Latency
[src]
Auto Trait Implementations
impl RefUnwindSafe for Latency
[src]
impl Send for Latency
[src]
impl Sync for Latency
[src]
impl Unpin for Latency
[src]
impl UnwindSafe for Latency
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,