Traits declare method signatures and optional defaults; `impl Trait for Type` provides them. The orphan rule requires either the trait or the type to be local. Traits underpin operator overloading, conversion and iteration.
← Rust theorytheory 0/50 · 0%
Abstraction · medium
22. Traits
Shared behaviour contracts.
Check your understanding
1. The orphan rule requires…
2. Can traits provide default methods?