Serde: Serialize doc comments

Created on 28 Nov 2018  路  3Comments  路  Source: serde-rs/serde

I'll point to a related suggestion from toml-rs. On that issue, Alex pointed out that serde doesn't exposes the doc comments, and if it's feasible, I'd like to suggest such feature.

enhancement

Most helpful comment

@dtolnay could you elaborate on why this (or in general, passing other metadata attributes to serializers) is not suitable in syn? I don't see how something like https://github.com/dtolnay/serde-yaml/issues/145 can be integrated with another proc macei easily, without rewriting/copying the whole serialization interface.

All 3 comments

That's a neat idea! I am closing the issue because I would prefer not to support this in Serde, but you could implement your own derive macro using Syn that makes doc comments available to a toml serializer.

@dtolnay could you elaborate on why this (or in general, passing other metadata attributes to serializers) is not suitable in syn? I don't see how something like https://github.com/dtolnay/serde-yaml/issues/145 can be integrated with another proc macei easily, without rewriting/copying the whole serialization interface.

@dtolnay could we support it under a feature flag?

Was this page helpful?
0 / 5 - 0 ratings