In a small saucepan, whisk together granulated sugar and eggs until fully combined. Heat over low, stirring constantly, until the mixture reaches 160°F and coats the back of a spoon. Remove from heat, then add the chocolate and vanilla, stirring until smooth. Allow to cool for about 5 minutes.
In a stand mixer with the paddle attachment, cream the butter on medium-high speed until it’s light and fluffy. Gradually mix in the cooled chocolate mixture, then beat on high until the mixture becomes fluffy, around 5 minutes.
In a separate bowl, whip the cream on medium-high speed until it thickens, about 3-4 minutes. Add powdered sugar and mix on low, then increase to medium-high until stiff peaks form. Gently fold the whipped cream into the chocolate mixture.
Spoon the filling into a pre-baked pie crust or tart shell. Refrigerate for at least 4 hours or overnight until fully set.
Before serving, top with whipped cream....and shaved chocolate, if you are feeling fancy.