What is the grammar behind the use of the quote marker と in this sentence?
雨がいつ降るかと大変楽しみにしていましたが、なかなか雨が降りません。
He was looking forward to when the rain would come, but...
Can I also write
雨が降ることを大変楽しみにしていましたが、なかなか雨が降りません。
He was looking forward to the rain coming, but...
and does it change the nuance?