Skip to content

Glossary: Rust Beyond the Basics

trait

Also written: traits

A named set of methods a type promises to have. Code that knows the trait can use any type that implements it, such as `Shippable`.

Where the book teaches it

Related terms

trait boundtrait objectdefault method