In the bowl of a stand mixer with the paddle attachment, or in a large bowl with a rubber spatula, combine the butter and confectioners’ sugar and mix until smooth.
Add the egg, almond flour and salt to the butter mixture and mix until combined.
Add the flour all at once and mix on low speed just until incorporated. The dough should just come together into a ball. As soon as it does, stop mixing or the pastry will lose its delicate short texture.
Divide the dough into two equal discs and wrap in plastic.
Set the dough in the fridge and leave to rest for at least 2 hours, or overnight.
Unwrap the dough, dust it with flour, and place it on a lightly floured surface. Roll to ⅛-inch (3-4mm) thick, rolling from the center outward in all directions. Lift and rotate a bit after every few strokes and dust with flour as needed to discourage sticking.
Carefully transfer the dough into the tart pan. Gently press the dough into place without stretching the dough or the sides will shrink while it bakes. Trim the edges with a sharp knife. Prick the base all over with a fork and place in the refrigerator or freezer for 30 minutes.
While the tart shell chills in the fridge, preheat the oven to 175°C (350°F).
Line the tart shell with parchment and fill with pie weights, beans or rice. Bake for 18-20 minutes, then remove the parchment and pie weights. Brush the crust with the egg white (save the yolk for the chocolate filling) to seal the shell, then bake for a further 6-7 minutes for a fully baked shell. The pastry should be a light golden brown.
Preheat the oven to 160°C (325°F).
Place a saucepan filled with an inch or two of water on the stove over medium-low heat. Place the chopped chocolate in a large heatproof bowl. Set the bowl over the saucepan, making sure the bottom of the bowl doesn’t touch the water. Melt the chocolate, stirring occasionally.
Remove from the heat, place a strainer over the bowl, and set aside, keeping the chocolate warm.
In a small bowl, beat together the egg, egg yolk, sugar, and 2 tablespoons of the single cream or half and half.
Pour the rest of the cream into a small saucepan and bring to the boil over medium heat. As soon as it begins to boil, remove from the heat. Make sure the cream is no longer boiling and whisk half of it into the egg mixture. Then whisk the tempered egg mixture back into the cream.
Place the saucepan back on the stove over low heat. Cook the custard until it reaches 70°C (158°F) on a candy thermometer, whisking constantly. This should take about 2 minutes.
Pour the hot custard through the strainer over the melted chocolate. Pour in the vanilla extract and the rum, if using. Using a rubber spatula, stir the chocolate and custard until fully combined, working from the center out to the sides. Stir gently as you don’t want to beat any air bubbles into the mixture.
Pour the chocolate custard into the pre-baked tart shell and bake for 8 - 9 minutes. The sides will have begun to thicken, but the middle will still be liquid. The filling will thicken as the tart cools.
Remove from the oven and cool for at least 2 hours.
