#![allow(dead_code, deprecated, unused_variables, unused_mut)] trait Foo { fn bar(&self) -> u8; fn baz(&self); fn qux(&self) -> Result; } struct MyStruct; impl Foo for MyStruct { fn bar(&self) -> u8 { 1 + 1 } fn baz(&self) { unimplemented!(); } fn qux(&self) -> Result { unimplemented!("MyStruct isn't quxable"); } } fn main() { let s = MyStruct; s.bar(); }