Open alexipeck opened 5 months ago
This is not possible unless we get an async effect system, which is years off if we'll get it at all.
The workaround for these cases is to write into a buffer and then serialize from the buffer asynchronously.
In your case that is deeply nested, you probably need to use block_on
I ask this on the tail end of async functions in traits being stabilized.
For context, with tokio::sync::RwLock wrapping a type, I would need the following as a custom serializer for a struct field:
Previously using a sync locking library like parking_lot, I had the following (as you can see, not much changed except for the await and library change):
Part of my problem is I can't even do a custom serializer without doing everything manually for the struct as there is currently no support for an async function.