snapview / tokio-tungstenite

Future-based Tungstenite for Tokio. Lightweight stream-based WebSocket implementation
MIT License
1.88k stars 236 forks source link

implement tokio_stream::StreamExt #272

Closed toxeus closed 1 year ago

toxeus commented 1 year ago

I'm a bit surprised that tokio-tungstenite doesn't implement tokio_stream::StreamExt but futures::stream::StreamExt. I think it wouldn't hurt to also implement the former for greater developer convenience.

agalakhov commented 1 year ago

The tokio_stream::StreamExt trait does not need to be implemented explicitly, it is implied for anything that implements Stream:

impl<St> StreamExt for St
where
    St: Stream + ?Sized,

so tokio-tungstenite has nothing to do with its implementation. It's implemented by tokio_stream. I wonder why it doesn't work for you.