So first, you need to CALM DOWN.
While there is some risk from rubbing, you aren't at risk for things like gonorrhea, chlamydia, HIV, hep B, or mycoplasma if there wasn't actual penetration.
You might be at risk for syphilis, herpes and HPV. The longer and harder the rubbing, the higher the risk.
There's no reason to panic like this.