Skip to content

Glossary: Software Design Patterns in Rust

Trait

Also written: traits

A named set of methods a type promises to have, written with `trait` and implemented with `impl`. It is Rust's interface and replaces inheritance for shared behavior.

Where the book teaches it

Related terms

InterfaceTrait objectDefault method