Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension trait for Sink #227

Open
fan-tom opened this issue Apr 24, 2020 · 2 comments · May be fixed by #229
Open

Extension trait for Sink #227

fan-tom opened this issue Apr 24, 2020 · 2 comments · May be fixed by #229
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fan-tom
Copy link
Contributor

fan-tom commented Apr 24, 2020

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.

@shepmaster shepmaster added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 24, 2020
@shepmaster
Copy link
Owner

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

@fan-tom
Copy link
Contributor Author

fan-tom commented Apr 25, 2020

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 fan-tom linked a pull request Apr 30, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants