This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait SomeTrait { | |
fn super_method(&self) { | |
println!("Hello world!"); | |
} | |
} | |
struct SomeStruct; | |
impl SomeTrait for SomeStruct {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Trait pet | |
/// Utilisable comme une "interface" ici | |
trait Pet { | |
fn sound(&self); | |
} | |
/// Struct Dog qui implémente le trait (interface) "Pet" | |
struct Dog; | |
impl Dog { |