Is there a good primer (spray can) to stop cast iron engine parts from rusting?

Epoxy primer in cans at my local Discount/Advance.

BTW I've never had to treat or prime an engine block assembly and the paint sticks good and doesn't rust for years and years.

Provided it's cleaned good IE pressure washing and liberal de-greaser.