I am trying to write a vector of objects into a solana account. The problem is, the pre-allocated size of the account might be too small for my vector. I know i can re-size the account with realloc
, but I still don't know the serialized size of my vector of objects, which I need to call realloc.
I could implement my own serialization logic, but I'd prefer not to do that.
Are there any serialization libraries out there that tell you the size of the serialized object before you serialize it?