Macro bancho_packets::packet_struct
source · macro_rules! packet_struct { ( $packet_id: expr, $(#[$struct_meta:meta])* $struct_name:ident $(< $($lifetimes:lifetime),* >)? { $( $(#[$field_meta:meta])* $field_name:ident: $field_type:ty$(,)* )* }, fn $fn:ident ($self:ident) -> $ret:ty $body:block ) => { ... }; ( $packet_id: expr, $(#[$struct_meta:meta])* $struct_name:ident $(< $($lifetimes:lifetime),* >)? { $( $(#[$field_meta:meta])* $field_name:ident: $field_type:ty$(,)* )* } ) => { ... }; }
Expand description
Impl bancho packet
Example
use crate::{
packet_struct, BanchoPacketLength,
BanchoPacketWrite,
};
packet_struct!(
PacketId::OSU_USER_CHANGE_ACTION,
/// #0: OSU_USER_CHANGE_ACTION
UserChangeAction<'a> {
online_status: u8,
description: Cow<'a, str>,
beatmap_md5: Cow<'a, str>,
mods: u32,
mode: u8,
beatmap_id: i32,
}
);