Skip to content

Field documentation #4

Closed
Closed

Description

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()?

Activity

  1. carllerche commented on Jan 5, 2018

    @carllerche
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions