Skip to main content

naia_shared/handshake/simple/
header.rs

1use naia_serde::SerdeInternal;
2
3use crate::handshake::RejectReason;
4use crate::ProtocolId;
5
6/// Discriminated-union header prepended to every simple-handshake packet.
7#[derive(SerdeInternal, Debug, PartialEq, Eq, Clone)]
8pub enum HandshakeHeader {
9    /// An initial handshake message sent by the Client to the Server.
10    ClientIdentifyRequest(ProtocolId),
11    /// The Server's response to the Client's initial handshake message.
12    ServerIdentifyResponse,
13    /// The handshake message sent by the Client to initiate a connection.
14    ClientConnectRequest,
15    /// The handshake message sent by the Server indicating the connection has been established.
16    ServerConnectResponse,
17    /// The Server's rejection response to the Client's connect request.
18    ServerRejectResponse(RejectReason),
19    /// Used to request a graceful Client disconnect from the Server.
20    Disconnect,
21}