Wikipedia gives a fuller quote and background information on the plot, which makes it easier to understand:
How happy is the blameless vestal's lot!
The world forgetting, by the world forgot.
Eternal sunshine of the spotless mind!
Each pray'r accepted, and each wish resign'd
In the context (of Eloise going into a monastery), the line in question means:
Eloise forgets about the world, and the world forgets about Eloise.
You can find the complete poem here.