Skip to main content

Version

Trait Version 

Source
pub trait Version:
    Copy
    + Send
    + Sync
    + 'static {
    type HandshakingServerbound: PacketSet;
    type StatusClientbound: PacketSet;
    type StatusServerbound: PacketSet;
    type LoginClientbound: PacketSet;
    type LoginServerbound: PacketSet;
    type PlayClientbound: PacketSet;
    type PlayServerbound: PacketSet;

    const PROTOCOL: i32;
    const NAME: &'static str;
    const POSITION_LAYOUT: PositionLayout;
}
Expand description

A protocol version: its number and the packet sets of every state and direction.

Implemented by the generated marker types (e.g. crate::v1_8::V1_8). A version-agnostic layer can be written generically over V: Version and map each version’s packet enums into common events.

Required Associated Constants§

Source

const PROTOCOL: i32

Protocol number sent in the handshake (47 for 1.8.x, 754 for 1.16.5).

Source

const NAME: &'static str

Human-readable version name (e.g. "1.8.9").

Source

const POSITION_LAYOUT: PositionLayout

Bit layout of packed block positions.

Required Associated Types§

Source

type HandshakingServerbound: PacketSet

Serverbound handshaking packets.

Source

type StatusClientbound: PacketSet

Clientbound status packets.

Source

type StatusServerbound: PacketSet

Serverbound status packets.

Source

type LoginClientbound: PacketSet

Clientbound login packets.

Source

type LoginServerbound: PacketSet

Serverbound login packets.

Source

type PlayClientbound: PacketSet

Clientbound play packets.

Source

type PlayServerbound: PacketSet

Serverbound play packets.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§