diff --git a/tokio-util/src/either.rs b/tokio-util/src/either.rs index 8a02398bc..e7fec9546 100644 --- a/tokio-util/src/either.rs +++ b/tokio-util/src/either.rs @@ -164,6 +164,39 @@ where } } +impl futures_sink::Sink for Either +where + L: futures_sink::Sink, + R: futures_sink::Sink, +{ + type Error = Error; + + fn poll_ready( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + delegate_call!(self.poll_ready(cx)) + } + + fn start_send(self: Pin<&mut Self>, item: Item) -> std::result::Result<(), Self::Error> { + delegate_call!(self.start_send(item)) + } + + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + delegate_call!(self.poll_flush(cx)) + } + + fn poll_close( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + delegate_call!(self.poll_close(cx)) + } +} + #[cfg(test)] mod tests { use super::*;