pub enum ConnectionProtocol {
Handshake,
Play,
Status,
Login,
Config,
}Expand description
Describes the set of packets a connection understands at a given point.
A connection always starts out in state ConnectionProtocol::Handshake. In this state,
the client sends its desired protocol using crate::packets::handshake::SClientIntention. The
server then either accepts the connection and switches to the desired
protocol, or it disconnects the client (for example, in case of an
outdated client).
Each protocol has a PacketListener implementation tied to it for
server and client respectively.
Every packet must correspond to exactly one protocol.
Variants§
Handshake
The handshake protocol. This is the initial protocol, in which the client tells the server its intention (i.e. which protocol it wants to use).
Play
The play protocol. This is the main protocol that is used while “in game” and most normal packets reside in here.
Status
The status protocol. This protocol is used when a client pings a server while on the multiplayer screen.
Login
The login protocol. This is the first protocol the client switches to to join a server. It handles authentication with the mojang servers. After it is complete, the connection is switched to the PLAY protocol.
Config
The configuration protocol. Used for syncing registered registries.
Trait Implementations§
Source§impl Clone for ConnectionProtocol
impl Clone for ConnectionProtocol
Source§fn clone(&self) -> ConnectionProtocol
fn clone(&self) -> ConnectionProtocol
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConnectionProtocol
Source§impl Debug for ConnectionProtocol
impl Debug for ConnectionProtocol
impl Eq for ConnectionProtocol
Source§impl Hash for ConnectionProtocol
impl Hash for ConnectionProtocol
Source§impl PartialEq for ConnectionProtocol
impl PartialEq for ConnectionProtocol
impl StructuralPartialEq for ConnectionProtocol
Auto Trait Implementations§
impl Freeze for ConnectionProtocol
impl RefUnwindSafe for ConnectionProtocol
impl Send for ConnectionProtocol
impl Sync for ConnectionProtocol
impl Unpin for ConnectionProtocol
impl UnsafeUnpin for ConnectionProtocol
impl UnwindSafe for ConnectionProtocol
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>