Skip to content

Field documentation #4

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

Closed
nbigaouette-eai opened this issue Jan 5, 2018 · 1 comment
Closed

Field documentation #4

nbigaouette-eai opened this issue Jan 5, 2018 · 1 comment

Comments

@nbigaouette-eai
Copy link

It'd be interesting to be able to add (structs' and fields') fields documentation.

For example:

let mut scope = Scope::new();

scope.new_struct("Foo").field("bar", "i64", "This is a `bar`");

could generate:

struct Foo {
    /// This is a `bar`
    bar: i64,
}

Or maybe a Field type would be useful which could be push_field()ed to a Struct, similarly to Scope::push_struct()?

@carllerche
Copy link
Owner

👍 I would probably not include the doc string as a third argument as that could get unwieldy.

A push_field would most definitely be useful either way, so we can add doc (and annotation) support to that.

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

No branches or pull requests

3 participants