Live eggs could be a problem in the closed up frame. Whatever hatches might like the environment and cause significant damage before they are noticed.
I suggest having the rug professionally cleaned or, if it is old and fragile, have a conservator treat it before framing.
One treatment that works for some critters is to deep-freeze the item for about a week, let it thaw for a week, and then freeze it again. As I understand it, the concept is to have the critters frozen through the end of their gestation cycle. Perhaps someone more knowledgeable can offer more accurate information on this technique.
Personally, I have never had to deal with that. On the couple of occasions when customers asked us to frame possibly-infested items, we have subcontracted conservators to treat them.