Although considered a vegetable, mushrooms are neither a plant nor animal food. They are a type of fungus that contains a substance called ergosterol, similar in structure to cholesterol in animals. Ergosterol can be transformed into vitamin D with exposure to ultraviolet light.