I am so so sorry for you. I have many cats, mostly rescued. 2 of my favorites are Mittens (snoeshoe) found as a tiny kitten on our back deck and Barney (white and tabby) found coming around eating food I had left out for the others. I could tell he was not ferral, just abandoned. I trapped him and brought him in Dec 1st 4 or 5 years ago. Isolated him, then got him fixed and let him in with the rest of the Population

Anyway Barney got sick, recently some sort of red bumps filled with blood but hard. Brought him to the vet and said it was binine??? skin cancer. He is susceptable to other cancers I am told. Anyway he is not looking better, worse he just lays around. I am so sad daily I cry almost everyday because he is the only one of them all that actually cuddled with me. We are leaving on the 16th for Disney and I am struggling to put him down as I do not want to leave him without his daily cuddles, all alone and sad knowing that it is inevitable. Anyway I really don't want to hijack your thread, but just to let you know you are not alone. Many people can relate.
Here is a story, that makes me somewhat happy, and relieved also. Hopefully for what it is worth it will make you and others comforted also. I had a cat, George, rescued from the Humane Society, boy that cat was smart. Had him for 10 years. I saw his last breath on my back deck. I couldn't eat for a week. Anyway, please don't laugh. I had a dream that I saw him and he was so healthy and running, green grass and trees. And the sound of birds chirping was sooo loud. He was happy in my dream. I never dreamt of him again. But it comforted me.
Your cat is fine now. He/ She knows how much you loved him and he had a good home.
I hope you feel better soon.