#[derive(ProtocolRW)]
{
// Attributes available to this derive:
#[Id]
#[Empty]
#[Raw]
#[Unknown]
#[NGS]
#[Classic]
#[NA]
#[JP]
#[Vita]
#[Category]
}
Available on crate feature
derive only.Expand description
Derive macro for protocol::ProtocolRW.
§Note
This macro makes few assumtions about the protocol enum:
- All packet must either have no fields or only one with a type that implements
protocol::PacketReadWrite. - Raw packet must either have no fields or only one with a
Vec<u8>inside. - Unknown packet must either have no fields or only one with a tuple of
(
protocol::PacketHeader,Vec<u8>) inside.
§Attribute explanation
#[Id(_id_, _subid_)]sets the ID and subID of the packet variant.#[Empty]marks the variant as empty, i.e. it will always return an empty vec.#[Raw]marks the variant that will receive raw data if requested.#[Unknown]marks the variant that will receive unknown packets.#[NGS]marks the packet as NGS-only.#[Classic]marks the packet as classic only, i.e. non-NGS packet (Vita, JP, NA).#[NA]marks the packet as NA classic only.#[JP]marks the packet as JP classic only.#[Vita]marks the packet as Vita only.#[Category(_category_)]sets the category of all the packets following this attribute.