Skip to content

Glossary: Software Design Patterns in Rust

derive

Also written: #[derive], #[derive(...)]

An attribute that asks the compiler to write standard trait code for a struct or enum, such as Clone, Debug, PartialEq or Default.

Where the book teaches it

Related terms

CloneDefault (trait)