pub enum ReceivedMessage {
ReceivedPacket {
source: PublicKey,
data: Bytes,
},
PeerGone(PublicKey),
Ping([u8; 8]),
Pong([u8; 8]),
KeepAlive,
Health {
problem: Option<String>,
},
ServerRestarting {
reconnect_in: Duration,
try_for: Duration,
},
}
Expand description
The type of message received by the Conn
from a relay server.
Variants§
ReceivedPacket
Represents an incoming packet.
PeerGone(PublicKey)
Indicates that the client identified by the underlying public key had previously sent you a packet but has now disconnected from the server.
Ping([u8; 8])
Request from a client or server to reply to the
other side with a ReceivedMessage::Pong
with the given payload.
Pong([u8; 8])
Reply to a ReceivedMessage::Ping
from a client or server
with the payload sent previously in the ping.
KeepAlive
A one-way empty message from server to client, just to
keep the connection alive. It’s like a ReceivedMessage::Ping
, but doesn’t solicit
a reply from the client.
Health
A one-way message from server to client, declaring the connection health state.
Fields
problem: Option<String>
If set, is a description of why the connection is unhealthy.
If None
means the connection is healthy again.
The default condition is healthy, so the server doesn’t broadcast a ReceivedMessage::Health
until a problem exists.
ServerRestarting
A one-way message from server to client, advertising that the server is restarting.
Trait Implementations§
Source§impl Clone for ReceivedMessage
impl Clone for ReceivedMessage
Source§fn clone(&self) -> ReceivedMessage
fn clone(&self) -> ReceivedMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !Freeze for ReceivedMessage
impl RefUnwindSafe for ReceivedMessage
impl Send for ReceivedMessage
impl Sync for ReceivedMessage
impl Unpin for ReceivedMessage
impl UnwindSafe for ReceivedMessage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)