trait Hello { fn hello(&self); } impl Hello for T { fn hello(&self) { println!("Hello {}!", self.to_string()); } } impl Hello for Vec { fn hello(&self) { println!("Hello {}!", self.to_string()); } } fn main(){ let a = vec!(5); a.hello(); }