#tokio #async #streammap

streammap-ext

StreamMap of Tokio with altered next that returns when stream is dropped

1 unstable release

0.1.0 Jul 20, 2022

#875 in Asynchronous

Download history 419/week @ 2024-08-02 711/week @ 2024-08-09 694/week @ 2024-08-16 370/week @ 2024-08-23 496/week @ 2024-08-30 318/week @ 2024-09-06 522/week @ 2024-09-13 394/week @ 2024-09-20 392/week @ 2024-09-27 739/week @ 2024-10-04 1300/week @ 2024-10-11 375/week @ 2024-10-18 356/week @ 2024-10-25 344/week @ 2024-11-01 215/week @ 2024-11-08 416/week @ 2024-11-15

1,374 downloads per month

MIT license

23KB
223 lines

streammap-ext

This is a fork of StreamMap from tokio-stream crate. The only difference between the implementations is that this version of StreamMap next returns Option<K,Option<V>> instead of Option<K,V>. This is to allow the developer to be aware when a stream is being dropped from the StreamMap, without the need to implement a Drop trait which can be troublesome in some cases (e.g. the drop flow requires async code).

After releasing this crate, I'll open a discussion to consider how to contribute it back to the original crate (as a different name, maybe a PhantomData that marks behavior, or maybe change the current behavior to this).

LICENSE

MIT - Same as source, all copy right goes to Tokio Contributors as this is a fork of tokio-stream crate.

Dependencies

~2.2–7.5MB
~50K SLoC