AbstractionTraits & impl blocks
All courses

Traits: Rust's interfaces (but make it coherent)

Define behavior with trait, implement with impl Trait for Type. Traits enable generics and static dispatch.

Think interfaces + type classes. Ferris the crab approves.

Output
Press Run to execute your code.