1 2 3 4 5 6 7 8 9 10 11
trait Display { fn fmt(self) -> String } record Point { x: Float, y: Float, } impl Display for Point { fn fmt(self) -> String { "(${self.x}, ${self.y})" } }