use std::fmt::Debug; use std::fmt::Display; // #[derive(Debug, Clone)] struct Point { x: T, y: T, } impl Point { fn show(&self) { println!("{:?} {:?}", self.x, self.y); } } fn main() { let p = Point { x: 1, y: 1 }; println!("{:?}", p); p.show(); let p2 = Point { x: 1.21, y: 2.2 }; println!("{:?}", p2); p2.show(); }