Struct ServerboundPlayPacket
#[non_exhaustive]pub struct ServerboundPlayPacket {
pub id: Identifier,
pub body: Vec<u8>,
}Expand description
A serverbound play packet encoded in the connected game’s vanilla protocol.
The game resolves the type name and decodes its body once before sending it. This is not a connection or a protocol implementation, and sending does not apply effects locally.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: IdentifierPacket type, for example minecraft:pong or minecraft:custom_payload.
body: Vec<u8>Vanilla packet body, without the packet id, length prefix or compression framing.
Implementations§
§impl ServerboundPlayPacket
impl ServerboundPlayPacket
pub fn new(id: Identifier, body: Vec<u8>) -> ServerboundPlayPacket
pub fn new(id: Identifier, body: Vec<u8>) -> ServerboundPlayPacket
Construct a packet envelope; the game validates the body when it is submitted.
Trait Implementations§
§impl Clone for ServerboundPlayPacket
impl Clone for ServerboundPlayPacket
§fn clone(&self) -> ServerboundPlayPacket
fn clone(&self) -> ServerboundPlayPacket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ServerboundPlayPacket
impl Debug for ServerboundPlayPacket
§impl PartialEq for ServerboundPlayPacket
impl PartialEq for ServerboundPlayPacket
impl StructuralPartialEq for ServerboundPlayPacket
Auto Trait Implementations§
impl Freeze for ServerboundPlayPacket
impl RefUnwindSafe for ServerboundPlayPacket
impl Send for ServerboundPlayPacket
impl Sync for ServerboundPlayPacket
impl Unpin for ServerboundPlayPacket
impl UnsafeUnpin for ServerboundPlayPacket
impl UnwindSafe for ServerboundPlayPacket
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
Mutably borrows from an owned value. Read more