WD40 is more of a solvent than a true RP. It will prevent rust but it is designed for short term rust prevention/water displacement. WD40 makes a long term rust inhibitor that is supposed to be pretty decent.
Many on here use fluid film, I personally am not that big of a fan of it. Having said that, my 99 donor vehicle was treated with fluid film for several years and the frame is pretty rust free. My other gripe with it is it makes a mess and leaves a heavy oil film on everything.
My personal choice is LPS 3 although it does leave a waxy film. Personally, I'd rather have a waxy film than an oily mess that picks up dirt and debris.
We use several RP's where I work because most of our customers require both short and long term protection on certain parts (mining industry, defense work ect). Because of this, I've had to do a bunch of research and look at the testing data from several manufactures (salt spray tests to ASTM standards) and most rust RPs you can find at your hardware store will not cut it for long term prevention, including WD40.
Now again, if you apply WD40 enough times throughout the year, it would probably work.
Here are couple links, one is from the Cortec corporation that makes some excellent RPs but again, nothing you can just buy in the store.
https://www.cortecvci.com/Publications/Reports/reports.php
This is from a machinist forum where he compared fluid film, WD40, and LPS 3.
Protective spray??? - Page 2
If you found a way to make WD40 protect your truck, I'm all ears. I'd be curious to hear how you're doing it and how many times it must be redone per year.