What you're describing is the prevention of corrosion (rust) by Cathodic Protection. It's commonly used to prevent rust on buried pipelines, and tanks.
CP can be done electrically through an impressed current, or chemically by using a Sacrificial Anode of magnesium, or zink.
Not sure it would work in keeping a salty steel frame from rusting. Better off cleaning the rust off, and coating bare metal with paint, or
oil.