Skip to content

Glossary: Software Design Patterns in Rust

Default (trait)

Also written: Default, Default::default(), #[derive(Default)]

A standard trait that gives a type a ready-made starting value. It works with `..Default::default()` to fill unnamed fields.

Where the book teaches it

Related terms

PrototypeStruct update syntax