Skip to content

Multiple Bits for Flag #7

Description

@robbym
#[derive(EnumFlags, Copy, Clone, Debug)]
#[repr(u8)]
pub enum GeneralStatus {
    INDICATOR_IDENTIFY    = 0b01000000,
    INDICATOR_MUTE        = 0b10000000,
    INDICATOR_NORMAL      = 0b11000000,

    PORT_AUTH_PANEL       = 0b00010000,
    PORT_AUTH_NETWORK     = 0b00100000,

    BOOT_ROM              = 0b00000100,
    RDM_CAPABLE           = 0b00000010,
    UBEA_PRESENT          = 0b00000001,
}

Gives the error:

The following flags are not unique: ["GeneralStatus::INDICATOR_IDENTIFY = 0b1000000", "GeneralStatus::INDICATOR_MUTE = 0b10000000", "GeneralStatus::IND
ICATOR_NORMAL = 0b11000000"]

Is this not possible? I can't change how these bits are laid out as they are part of an existing network protocol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions