[][src]Enum naia_shared::PacketType

#[repr(u8)]pub enum PacketType {
    Data,
    Heartbeat,
    ClientChallengeRequest,
    ServerChallengeResponse,
    ClientConnectRequest,
    ServerConnectResponse,
    Unknown,
}

An enum representing the different types of packets that can be sent/received

Variants

Data

A packet containing Event/Entity data

Heartbeat

A packet sent to maintain the connection by preventing a timeout

ClientChallengeRequest

An initial handshake message sent by the Client to the Server

ServerChallengeResponse

The Server's response to the Client's initial handshake message

ClientConnectRequest

The final handshake message sent by the Client

ServerConnectResponse

The final handshake message sent by the Server, indicating that the connection has been established

Unknown

An unknown packet type

Implementations

impl PacketType[src]

pub fn get_from_packet(payload: &[u8]) -> PacketType[src]

Given all the bytes of an incoming packet, get the PacketType from the header

Trait Implementations

impl Clone for PacketType[src]

impl Copy for PacketType[src]

impl Debug for PacketType[src]

impl From<u8> for PacketType[src]

impl PartialEq<PacketType> for PacketType[src]

impl StructuralPartialEq for PacketType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.