3 ms·
Rust's traits let you add methods like this to any type without creating a risk of conflicts, because they aren't accessible within a particular file unless you
by TazeTSchnitzel 5y ago
Rust's traits let you add methods like this to any type without creating a risk of conflicts, because they aren't accessible within a particular file unless you import the trait. (Also I think there's some syntax for disambiguating?)
- remram 5y agoThe syntax is function-style, e.g. `Trait::method(object)` rather than ` use Trait; object. method()` Or you can cast &object to &Trait.