Derive Macro base::EventToken

source ·
Expand description

Implements the EventToken trait for a given enum.

There are limitations on what enums this custom derive will work on:

  • Each variant must be a unit variant (no data), or have a single (un)named data field.
  • If a variant has data, it must be a primitive type castable to and from a u64.
  • If a variant data has size greater than or equal to a u64, its most significant bits must be zero. The number of bits truncated is equal to the number of bits used to store the variant index plus the number of bits above 64.