An expression basically meaning that you can only have it so good, and you can't have it all.
An good example is if a situation is bittersweet
Sara was sad that the guy whom had gotten very close to her in the past 3 years which she held a secret fondness for developed an interest in her best friend, Clare. In conversation with Clare, Sara explained the situation, to which Clare responded.
"You can't have your cake and eat it too."