Preheat oven to 200 C / Gas 6. Line a baking tray with baking parchment.
In a frying pan, cook and stir the onions and mushrooms in butter, until soft.
In a saucepan, combine the rice and stock and cook, until rice is tender and liquid is absorbed.
Mix together onions, mushrooms, rice, salmon, eggs and season with salt and pepper to taste.
Roll out the pastry into a rectangle or square. Spoon the salmon and rice over one half the pastry, and then fold the second half over. Seal the edges by pressing with your fingers. Glaze with egg and cut small slits the top.
Bake for 20 minutes in the preheated oven, then turn temperature down to 180 C / Gas 4 and cook for another 15 minutes.