Skip to content

feat: idl @bit_bound or rust repr(...) #418

@carlocorradini

Description

@carlocorradini

Currently, DdsType ignores the #[repr(...)] attribute and determines the discriminant by simply counting the number of variants, rounding to the nearest representation. While this usually works, it fails in cases where a specific representation is explicitly defined.

For example, if we declare #[repr(u16)], DdsType will still generate a discriminator of type u8:

#[derive(DdsType)]
#[repr(u16)]
pub enum MyEnum {
    Value0 = 0,
    Value1,
    Value2,

This behavior is also reflected in the IDL generator, where we specify @bit_bound (no yet implemented).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions