Macro gba_proc_macro::bool_bits
source · bool_bits!() { /* proc-macro */ }
Expand description
Generates one or more virtual bool fields within a type.
You must use this within an impl
block for a tuple struct that has an
integral type as the 0th field.
Give the type of self.0
, a comma, and then a Group, which itself contains
comma separated Group values, each of which should be formatted as (bit, field_name)
, no more than one per bit. Something like this:
impl Demo {
bool_bits!(
u16,
[
(3, cgb_mode),
(4, page1_enabled),
(5, hblank_interval_free),
(6, object_memory_1d),
(7, force_blank),
(8, display_bg0),
(9, display_bg1)
]
);
}