Skip to content

Glossary: Rust in Practice

default (serde attribute)

Also written: #[serde(default)]

A serde attribute that fills a missing field with its type's default, such as `false` or `0`, or with the result of a function you name.

Where the book teaches it

Related terms

serde