January 2019
Beginner to intermediate
554 pages
13h 31m
English
This is the simplest form a trait definition could possibly be. We already discussed this as an introduction to traits:
trait Foo { fn foo();}
An example from the standard library would be the Default trait, which is implemented for types that can be initialized with a default value. It is documented at https://doc.rust-lang.org/std/default/trait.Default.html.
Read now
Unlock full access