Chocolate Lover’s Cream Pie

1 pre-baked gluten-free pie crust (see Tasty Pie Crust recipe)
3/4 cup sugar
1/4 cup cocoa
3 tablespoons cornstarch
1/8 teaspoon salt
2 cups milk
1 egg, lightly beaten
1-1/2 ounces semisweet chocolate, grated
1 teaspoon vanilla
2-1/2 cups whipped topping

Combine sugar, cocoa, cornstarch, salt, and milk in a medium saucepan; stir well with a whisk. Cook, stirring constantly, for 1 minute until mixture comes to a full boil. Gradually add 1/3 cup of this hot mixture to beaten egg, stir well. Return egg mixture to pan. Cook 2 minutes or until mixture thickens, stirring constantly. Remove from heat; add grated chocolate, stirring until the chocolate melts and mixture is smooth. Stir in vanilla. Spoon mixture into pie crust. Cover surface of filling with plastic wrap. Chill until set (about 2 hours). Remove plastic wrap; spread whipped topping evenly over filling.