Pastry is a snack. Look at the word "rice" to the left of the word "cake". Therefore, it generally refers to the food cooked with rice, flour and other grains as the main raw materials, with auxiliary materials and seasonings. Pastry includes cakes with or without stuffing, such as cakes and biscuits, as well as cakes with stuffing, such as moon cakes and bread with stuffing. Traditionally, this kind of preformed food made by steaming, boiling, burning, roasting, frying, frying and branding is called, which is very suitable for mass production.
There is no strict definition of the scope of the cake, just a convention.
The steamed stuffed bun you mentioned is not a cake, and jiaozi and Tangyuan are snacks, not cakes.