דילוג לתוכן הראשי
0

השיעור הזה זמין כרגע באנגלית.

One behaviour, many types

A Player and a Game are different types, yet both can describe themselves. A trait names that shared ability, and generics let one function work for every type that has it. Together they are how Rust reuses code, with no inheritance.