pub struct ConnectedPing {
pub time: i64,
}
Expand description
This packet is sent by either the client or the server to the other peer.
The other peer should respond with a ConnectedPong
packet. In general
you should be sending this packet every 5 seconds to keep the connection alive.
If you do not continue to send this packet, the connection will be closed after
the other peer does not receive a ConnectedPong
packet for the configured timeout option.
Fields§
§time: i64
The time you sent the packet to the peer.
Trait Implementations§
Source§impl Clone for ConnectedPing
impl Clone for ConnectedPing
Source§fn clone(&self) -> ConnectedPing
fn clone(&self) -> ConnectedPing
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConnectedPing
impl Debug for ConnectedPing
Source§impl From<ConnectedPing> for OnlinePacket
impl From<ConnectedPing> for OnlinePacket
Source§fn from(packet: ConnectedPing) -> Self
fn from(packet: ConnectedPing) -> Self
Converts to this type from the input type.
Source§impl From<ConnectedPing> for RakPacket
impl From<ConnectedPing> for RakPacket
Source§fn from(packet: ConnectedPing) -> Self
fn from(packet: ConnectedPing) -> Self
Converts to this type from the input type.
Source§impl From<OnlinePacket> for ConnectedPing
impl From<OnlinePacket> for ConnectedPing
Source§fn from(packet: OnlinePacket) -> Self
fn from(packet: OnlinePacket) -> Self
Converts to this type from the input type.
Source§impl From<RakPacket> for ConnectedPing
impl From<RakPacket> for ConnectedPing
Source§impl Reader<ConnectedPing> for ConnectedPing
impl Reader<ConnectedPing> for ConnectedPing
Source§fn read(_binary_readerr: &mut ByteReader) -> Result<ConnectedPing, Error>
fn read(_binary_readerr: &mut ByteReader) -> Result<ConnectedPing, Error>
Source§impl Writer for ConnectedPing
impl Writer for ConnectedPing
Source§fn write_to_bytes(&self) -> Result<ByteWriter, Error>
fn write_to_bytes(&self) -> Result<ByteWriter, Error>
This is a utility function to write
Self
to a ByteWriter
without
needing to create a ByteWriter
first.Auto Trait Implementations§
impl Freeze for ConnectedPing
impl RefUnwindSafe for ConnectedPing
impl Send for ConnectedPing
impl Sync for ConnectedPing
impl Unpin for ConnectedPing
impl UnwindSafe for ConnectedPing
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