In a large bowl, lightly beat the eggs, then whisk in the sugar, lime zest, rum (if using) and salt. In a separate bowl, whisk together the flour and butter until full blended, then whisk them into the egg mixture. Stir in the pineapple.
Roll out one half of the dough into a circle about 11 inches in diameter. Transfer to a 9-inch pie plate, trim the overhang to 1 inch, and fill it with the pineapple mixture.
Roll out the remaining circle of dough to about 10 inches, lay it over the pie, and trim and crimp the edges to your liking. Brush the top with egg wash, sprinkle with raw sugar, and cut slits in the top crust.
Bake the pie on a baking sheet for 20 minutes, rotating it once halfway through. Lower the temperature to 350°F, and bake it for another 30 to 40 minutes, until the crust is nicely browned and full baked and the filling doesn’t jiggle under the crust when the baking sheet is moved. Allow the pie to cool completely before serving. This pie can be kept refrigerated for up to 1 week; allow it to come to room temperature or heat it gently in a warm oven before serving. This pie can also be frozen after baking: Wrap it well in plastic, then in foil, and freeze it for up to 2 months.