Rather than taking in a Stream and advancing it internally, return a
Sink that can be advanced by the calling code. This significantly
simplifies encoding logic for things like tokio-postgres-binary-copy.
Similarly, the blocking interface returns a Writer.
Closes#489
Benchmarks indicate that malloc accounts for a significant amount of the
runtime of queries. The message buffer accounts for ~half of that (the
other being channels), and this change should eliminate it.
This is the template that we'll use for all other methods taking
parameters. The `foo_raw` variant is the most flexible (but annoying to
use), while `foo` covers the expected common case.
Change the slice-consuming methods to requiring &(dyn ToSql + Sync),
which makes the overall value Send. If you have non-Sync values for
whatever reason, you can still use the iterator-based methods.