I doubt him being in contact with a rusty nail for a few seconds would hurt him, but I would still keep a close eye on him for the next few days to look for signs of illness. Since it was just a nail holding up a mirror, may I suggest you replace it with a non-rusty one so the same thing doesn't happen again?
Also, even the most closely supervised birds get their beaks on things they oughtn't from time to time. My mom always made her birds bite on a wet towel after they got a hold of something bad, to kind of "wash" their mouth out of as much residue as possible. I do the same thing with Kiwi (he has a special love of highlighters, and will help himself to one if your not looking). It's more visible with a highlighters of course, but it definitely wipes out their beaks! I'd suggest in the future, you give it a try as another way to keep your bird safe and healthy if they do get a hold of something potentially toxic.