3 ms·
Rust has flat level class: Struct and its implementation methods. No inheritance here. Struct method can be called as struct_obj.func1(). Rust also has Trait
by ww520 10y ago
Rust has flat level class: Struct and its implementation methods. No inheritance here. Struct method can be called as struct_obj.func1().
Rust also has Trait, which is like interface, with a set of method function signatures. A Trait is implemented for a Struct to have concrete method implementation. Trait supports inheritance.