Breast feeding

I know I’m not going to have to worry about this till September, but can you pump during labor? or shortly after labor? i know I’m not going to be able to breast feed but i want my baby to have breast milk, not formula, for as long as I’m able to pump when i have them... I’ve never heard of anyone doing this so i don’t know if its allowed or not