Skip to content

Glossary: Rust Beyond the Basics

derive

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

An attribute that has the compiler write a trait implementation for you, as in `#[derive(Debug, Clone)]`. It works only if every field has the trait.

Where the book teaches it

Related terms

CloneCopyPartialEq