snafu icon indicating copy to clipboard operation
snafu copied to clipboard

Extension trait for Sink

Open fan-tom opened this issue 5 years ago • 2 comments

Currently, you cannot convert Sink::Error with .context. I suggest to add extension trait, similar to TryStreamExt, for Sinks, to make error conversion more convinient.

fan-tom avatar Apr 24 '20 17:04 fan-tom

That seems reasonable. I was under the impression that Sinks were semi-deprecated, which is why I didn't add support for them originally.

General shape of how this would work:

  1. Add sink.rs to src/futures01/ and src/futures/, importing them from the relevant modules.
  2. Tests should be added to /compatibility-tests/futures-0.1 and /compatibility-tests/futures

shepmaster avatar Apr 24 '20 21:04 shepmaster

Sink trait in futures 0.3 is placed under futures-sink crate, while futures reexprots it. Snafu already depends on futures (internal-dev-dep), should I hide extension trait behind feature flag, or make futures dependency mandatory?

fan-tom avatar Apr 25 '20 07:04 fan-tom