DEV Community

Discussion on: My first impressions of Rust

Collapse
 
simonvoid profile image
Stephan Schröder

The big advantage of traits over interfaces, is that you can implement (your) traits on structs that you don't have source control over (-> structs from any lib you use).
Orphan rules apply: you can't implement other people's traits on other people's structs (because those could clash with other people's implementations), but all other combinations of who wrote trait and struct work.