First I realized that the fix in #1565 only fixed try_recv. recv had the same issue and that was unfixed. So this PR adds the fix to recv as well.
I realized that fixing #1565 introduced a bunch of needless allocations. The fix to this is to have the user pass in the &mut Vec<Message> that they will be adding to. This is a fairly ergonomic solution since sinks often directly append the result to another vec anyway.
In doing this I renamed recv -> recv_into and try_recv -> try_recv_into to better suit the new functionality.
Additionally I had to port all the transforms to use this new API.
This PR improves SinkConnection to be more robust and efficient. https://github.com/shotover/shotover-proxy/pull/1565 started on this work but I didnt realize how deep the issue went.
recv
as well.&mut Vec<Message>
that they will be adding to. This is a fairly ergonomic solution since sinks often directly append the result to another vec anyway.recv
->recv_into
andtry_recv
->try_recv_into
to better suit the new functionality.