pub struct Ping {
pub timestamp: Option<u64>,
pub good: Option<u32>,
pub late: Option<u32>,
pub lost: Option<u32>,
pub resync: Option<u32>,
pub udp_packets: Option<u32>,
pub tcp_packets: Option<u32>,
pub udp_ping_avg: Option<f32>,
pub udp_ping_var: Option<f32>,
pub tcp_ping_avg: Option<f32>,
pub tcp_ping_var: Option<f32>,
}Expand description
Sent by the client to notify the server that the client is still alive. Server must reply to the packet with the same timestamp and its own good/late/lost/resync numbers. None of the fields is strictly required.
Fields§
§timestamp: Option<u64>Client timestamp. Server should not attempt to decode.
good: Option<u32>The amount of good packets received.
late: Option<u32>The amount of late packets received.
lost: Option<u32>The amount of packets never received.
resync: Option<u32>The amount of nonce resyncs.
udp_packets: Option<u32>The total amount of UDP packets received.
tcp_packets: Option<u32>The total amount of TCP packets received.
udp_ping_avg: Option<f32>UDP ping average.
udp_ping_var: Option<f32>UDP ping variance.
tcp_ping_avg: Option<f32>TCP ping average.
tcp_ping_var: Option<f32>TCP ping variance.
Implementations§
Source§impl Ping
impl Ping
Sourcepub fn timestamp(&self) -> u64
pub fn timestamp(&self) -> u64
Returns the value of timestamp, or the default value if timestamp is unset.
Sourcepub fn resync(&self) -> u32
pub fn resync(&self) -> u32
Returns the value of resync, or the default value if resync is unset.
Sourcepub fn udp_packets(&self) -> u32
pub fn udp_packets(&self) -> u32
Returns the value of udp_packets, or the default value if udp_packets is unset.
Sourcepub fn tcp_packets(&self) -> u32
pub fn tcp_packets(&self) -> u32
Returns the value of tcp_packets, or the default value if tcp_packets is unset.
Sourcepub fn udp_ping_avg(&self) -> f32
pub fn udp_ping_avg(&self) -> f32
Returns the value of udp_ping_avg, or the default value if udp_ping_avg is unset.
Sourcepub fn udp_ping_var(&self) -> f32
pub fn udp_ping_var(&self) -> f32
Returns the value of udp_ping_var, or the default value if udp_ping_var is unset.
Sourcepub fn tcp_ping_avg(&self) -> f32
pub fn tcp_ping_avg(&self) -> f32
Returns the value of tcp_ping_avg, or the default value if tcp_ping_avg is unset.
Sourcepub fn tcp_ping_var(&self) -> f32
pub fn tcp_ping_var(&self) -> f32
Returns the value of tcp_ping_var, or the default value if tcp_ping_var is unset.
Trait Implementations§
Source§impl Message for Ping
impl Message for Ping
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.