The anus is the opening of the rectum (the lower part of the large intestine) through which stool passes out of your body. Problems with the rectum and/or the anus are common and objects used for sexual stimulation may become lodged unintentionally in the rectum after being passed through the anus.
If you're only experiencing bloating and trapped gas, this may pass. Symptoms such as acute pain or anal discomfort are probably more worrisome. Other symptoms depend on the size and shape of the object, how long it has been there, and whether it has perforated (pierced) the anus or rectum or caused an infection.
An abdominal examination, sigmoidoscopy, and x-rays are the diagnostic procedures needed to make sure the wall of the large intestine has not been perforated, however. Natural movements of the wall of the large intestine (peristalsis) may release the trapped gas, but if you still experience symptoms 36-48 hours after anal penetration, I'd suggest that you see a doctor.