Skip to content

Expose the type as a static method with the derive macros #7

Description

@vincenzopalazzo

We currently use the following code to derive and match the type.

#[derive(DecodeWire, EncodeWire, Debug)]
pub struct Init {
    #[warn(dead_code)]
    #[msg_type=16]
    ty: u16,
    globalfeatures: BitFlag,
    features: BitFlag,
    init_tlvs: Stream,
}

Unfortunately, we cannot access the message type using a static method like Init::type(). This feature would be especially useful when working with a generic parser on the command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-hightHiight Priotity issueenhancementNew feature or request🪄 - deriveRelated to the Derive crate

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions