The pileus is the technical name for the cap, or cap-like part, of a basidiocarp or ascocarp (fungal fruiting body) that supports a spore-bearing surface, the hymenium.
The pileus is the cap-like structure on a mushroom, which helps to protect and support the hymenium, where spores are released.