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:
Also Serialize:
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.
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 didcargo doc
in my project and navigated toserde_derive
and was a bit disappointed to see the following:Also
Serialize
: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
.