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.
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?
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.