Preheat oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.
Whisk together flour, baking powder, and salt in a bowl.
Cream butter and sugar until light and fluffy. Beat in eggs one at a time, then add vanilla.
Alternate mixing dry ingredients with milk until smooth. Stir in rum.
Pour batter evenly into pans and bake for 25–30 minutes, or until a toothpick inserted comes out clean. Cool completely.
Prepare rum syrup: Boil water and sugar until dissolved. Remove from heat and stir in rum. Let cool.
Make pastry cream: Heat milk until warm. In a separate bowl, whisk sugar, yolks, and cornstarch. Gradually add warm milk, then cook over medium heat until thick. Remove from heat, stir in butter and vanilla, and cool.
Assemble cake: Brush each cake layer with rum syrup. Spread pastry cream between layers.
Whip cream with powdered sugar until soft peaks form. Frost cake and garnish with chocolate shavings or sliced almonds.
Chill for at least 2 hours before serving to allow flavors to blend.