Skip to main content

PacketSet

Trait PacketSet 

Source
pub trait PacketSet: Sized {
    const STATE: State;
    const DIRECTION: Direction;

    // Required methods
    fn decode_raw(raw: &RawPacket) -> DecodeResult<Self>;
    fn id(&self) -> i32;
    fn name(&self) -> &'static str;
    fn encode_body(&self, w: &mut BytesMut) -> EncodeResult;
    fn name_of(id: i32) -> Option<&'static str>;
}
Expand description

All packets of one version, state and direction as an enum (generated).

Required Associated Constants§

Source

const STATE: State

Connection state of this set.

Source

const DIRECTION: Direction

Direction of this set.

Required Methods§

Source

fn decode_raw(raw: &RawPacket) -> DecodeResult<Self>

Decodes a raw packet into the matching variant (strict: no trailing bytes).

Source

fn id(&self) -> i32

Packet id of this value.

Source

fn name(&self) -> &'static str

minecraft-data name of this value.

Source

fn encode_body(&self, w: &mut BytesMut) -> EncodeResult

Encodes the packet body (without the id).

Source

fn name_of(id: i32) -> Option<&'static str>

minecraft-data name for a packet id, if the id is known.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PacketSet for ghast_protocol::v1_8::handshaking::clientbound::ClientboundHandshakingPacket

Source§

const STATE: State = State::Handshaking

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::handshaking::clientbound::ClientboundHandshakingPacket

Source§

const STATE: State = State::Handshaking

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_8::login::clientbound::ClientboundLoginPacket

Source§

const STATE: State = State::Login

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::login::clientbound::ClientboundLoginPacket

Source§

const STATE: State = State::Login

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_8::play::clientbound::ClientboundPlayPacket

Source§

const STATE: State = State::Play

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::play::clientbound::ClientboundPlayPacket

Source§

const STATE: State = State::Play

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_8::status::clientbound::ClientboundStatusPacket

Source§

const STATE: State = State::Status

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::status::clientbound::ClientboundStatusPacket

Source§

const STATE: State = State::Status

Source§

const DIRECTION: Direction = Direction::Clientbound

Source§

impl PacketSet for ghast_protocol::v1_8::handshaking::serverbound::ServerboundHandshakingPacket

Source§

const STATE: State = State::Handshaking

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::handshaking::serverbound::ServerboundHandshakingPacket

Source§

const STATE: State = State::Handshaking

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_8::login::serverbound::ServerboundLoginPacket

Source§

const STATE: State = State::Login

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::login::serverbound::ServerboundLoginPacket

Source§

const STATE: State = State::Login

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_8::play::serverbound::ServerboundPlayPacket

Source§

const STATE: State = State::Play

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::play::serverbound::ServerboundPlayPacket

Source§

const STATE: State = State::Play

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_8::status::serverbound::ServerboundStatusPacket

Source§

const STATE: State = State::Status

Source§

const DIRECTION: Direction = Direction::Serverbound

Source§

impl PacketSet for ghast_protocol::v1_16_5::status::serverbound::ServerboundStatusPacket

Source§

const STATE: State = State::Status

Source§

const DIRECTION: Direction = Direction::Serverbound