serde-rs / serde

Serialization framework for Rust
https://serde.rs/
Apache License 2.0
8.81k stars 747 forks source link

Offline documentation #2757

Open wezm opened 2 weeks ago

wezm commented 2 weeks ago

Yesterday I was doing some programming on an aeroplane flight. I wanted to control how an enum was serialized but could not remember the exact attribute to use. I did cargo doc in my project and navigated to serde_derive and was a bit disappointed to see the following:

Screenshot 2024-06-18 at 08-21-08 serde_derive - Rust

Also Serialize:

Screenshot 2024-06-18 at 08-21-25 Serialize in serde_derive - Rust

Without internet access I was a bit stuck. Hopefully I did not miss this documentation's availabiliy somewhere else. If not, It would be great if there was content like https://serde.rs/container-attrs.html on the rustdoc generated pages, even if it was a cut down version.

In the end I was able to work out that #[serde(tag = "type")] was what I was after by searching through all the downloaded crates on my system: rg '#\[serde' ~/.cargo.