1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
pub struct Gus { a: String, } impl Gus { fn do_it(&self) {} fn do_it2(&self) {} } struct Example { number: i32, } impl Example { fn boo() { println!("boo! Example::boo() was called!"); } fn answer(&mut self) { self.number += 42; } fn get_number(&self) -> i32 { self.number } } pub trait Thing { fn self_sized(self) where Self: Sized {} } #[derive(Default)] pub struct Test { pub i: i64, pri: i64, }