Derive Macro ProtocolRW

Source
#[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:

§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.