Enum representations: Externally tagged, internally tagged, adjacently tagged, and untagged ways of representing an enum in self-describing formats.
Default value for a field: Some examples of the
Handwritten generic type bounds: Some unusual scenarios in
which Serde's derive infers the wrong generic type bounds. The impl bounds can
be replaced with handwritten ones using the
Deserialize for custom map type: Detailed explanation of each step involved in deserializing a map.
Array of values without buffering: Deserialize the maximum value of an array of integers without holding the whole array in memory at once. This approach can be adapted to handle a variety of other situations in which data needs to be processed while being deserialized instead of after.
Serialize enum as number: A macro to impl
Deserialize for a C-like enum in a way that represents it as a
all data formats.
Serialize fields as camelCase: One common application of
Skip serializing field: Some examples of the
Derive for remote crate: Deriving
Deserialize implementations for a type in somebody else's crate.
Manually deserialize struct: The long form of the
Deserialize impl generated by derive for a simple struct.
Discarding data: Using
IgnoredAny to efficiently discard
data from a deserializer.
Convert error types: Map a Serde error from some format
into a Serde error for some other format using