antifuchs / ratelimit_futures

Rate-limiting for rust futures v0.1
MIT License
5 stars 2 forks source link

Add stream/sink combinators and move the limiter instead of taking it by &mut #4

Closed Johni0702 closed 5 years ago

Johni0702 commented 5 years ago

The stream and sink extension traits, impls and structs are very similar (to the point where one could easily combine them into one). I've kept them separate though as otherwise one would always be forced to ratelimit both directions of a Stream+Sink object and there would be no way to limit just the Stream part while letting the Sink pass through unhindered.

Changing the limiter from &mut to move is a prerequisite to implementing any combinator, otherwise I would have split this into two PRs.

antifuchs commented 5 years ago

bors r+

bors[bot] commented 5 years ago

Build succeeded

antifuchs commented 5 years ago

Thank you for the contribution!!