Get Started with Rust: Traits
Get Started with Rust: Traits A trait is a basic language concept for defining shared behavior on types. Traits describe an interface that types can implement. Rust traits are a sibling of Scala traits and Haskell type classes, as well as a cousin of C++ and Java interfaces. This article will show you how to use traits in Rust. After reading it, you’ll be able to answer these questions: What is a trait? Why do we use traits […]