trait in Rust

A trait in Rust is a group of methods that are defined for a particular type. Traits are an abstract definition of shared behaviour amongst different types. So, in a way, traits are to Rust what interfaces are to Java or abstract classes are to C++. A trait method is able to access other methods within that trait.