Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

XRBK macro: conditionally enable parsing based on given derive traits #50

@Antikyth

Description

@Antikyth

There is certain macro syntax which should be parsed or not parsed depending on which XRBK traits one derives.

For example, a let element would be parsed if any of these traits are derived:

  • X11Size
  • ConstantX11Size
  • Readable

...but without the source used to write it:

let name_len: u16

Only if Writable is derived would it have a source:

let name_len: u16 = name => name.len() as u16

Also, if the macro syntax is parsed conditionally depending on which traits are derived, then all structs should be parsed custom, not just those with at least one XRBK trait. This is so that requests, replies, events, and errors may still be implemented without deriving their XRBK traits (you really should, but for consistency, and therefore each of learning, it wouldn't be required). It also means better errors can be given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtaskAn essential task for a planned milestone.

    Type

    No type

    Projects

    Status

    Unassigned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions