As long as it wasn't something that could get lodged in their throat or stomach they should be alright . Keep an eye on their breathing and bowel movements. Make sure everything is working fine. If not take them to a vet. My dogs have eaten a number of things from shale to rabbit poop.
Give your dog a meal of cooked rice. Rice acts as a buffer for the digestive system helping things pass.
Monitor your dog's poo for stool problems. Blood or tarry poo.
You didn't say how much rust your dog ate (?)