Documentation of structs?

In xml-rs library doc, there are four structs, two from writer and two from reader. The documentation says two structs are re-exports, and the other two are shown as if they are written in file. But all the structs are re-exports?

Why is the documentation shown this way?

In the case of EventReader and EventWriter, they are defined in public modules elsewhere in the crate, so when the root module re-exports them rustdoc refers to their original paths. For EmitterConfig and ParserConfig, they’re defined in private modules (writer::config and reader::config). Rustdoc doesn’t want to show you those paths, because from the point of view of the user they don’t exist (there’s no module documentation for them), so it just makes them look like they’re defined at the point where they’re reexported, at the crate root.

1 Like