Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for documentation of enum variants in enum generation macros #37

Closed
Eonm opened this issue Sep 27, 2019 · 3 comments
Closed
Assignees
Milestone

Comments

@Eonm
Copy link

Eonm commented Sep 27, 2019

Hi,

It is possible to document each enum variant created with the macro impl_var_trait! ?

    impl_var_trait!(
    /// nl80211Commands
    ///
    /// Enumeration from nl80211/nl80211.h:880
    Nl80211Cmd, u8, Cmd,
    CmdUnspec                  => 0,
    /// Request information about a wiphy or dump request to get a list of all present wiphys.
    /// How can I document this enum variant ?
    CmdGetWiphy                => 1,
    CmdSetWiphy                => 2
    );

Thanks

@jbaublitz jbaublitz self-assigned this Sep 28, 2019
@jbaublitz jbaublitz added this to the 0.5.0 milestone Sep 28, 2019
@jbaublitz
Copy link
Owner

Hi @Eonm, I'm going to be reworking the macros as part of #19. I can certainly add support for variant documentation. I don't tend to use it because of the number of enums I support out of the box and I'm not always entirely sure what each one represents due to lack of netlink documentation. However because it's exposed as part of the library, this makes sense to support. I'll edit this issue and will add this feature as I do #19.

@jbaublitz jbaublitz changed the title [question] impl_var_trait! macro : document each enum variant Add support for documentation of enum variants in enum generation macros Sep 28, 2019
@Eonm
Copy link
Author

Eonm commented Sep 28, 2019

Indeed, lack of documentation seems to be the rule with netlink.

I tried to figure out how to implement this feature myself, but i never used rust macros before.

Thank you for your reply.

@jbaublitz
Copy link
Owner

This should be resolved in commit b00b0bb. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants