Re:Abstraction without overhead: traits in Rust
by GolDDranks on Monday May 11, 2015 @04:22PM
(#9527585)
> Traits are somewhat between an interface and a mixin: an interface is made only of method signatures, while a trait includes also the full method definitions, on the other side mixins include method definitions, but they can also carry state through attributes while traits usually don't.
Rust's traits may specify just a method signature and force the implementor of the trait to implement the method, but they may specify full definitions of methods too.
Rust's traits may specify just a method signature and force the implementor of the trait to implement the method, but they may specify full definitions of methods too.