In a saucepan, melt the butter, and cook the onion until soft.
Add the mushrooms, and cook for 4 minutes.
In a buttered casserole or baking dish, evenly spread a layer of half of the macaroni.
Sprinkle the onions and mushrooms evenly on top, and cover with a layer of the remaining macaroni.
In a bowl, blend the cream, eggs, salt, and pepper; pour over the macaroni.
Sprinkle the top with breadcrumbs; bake, uncovered, in a preheated 350-degree oven for 25 minutes, or until the custard has set and the top is golden.