use std::future::Future;
use super::Sink;
pub trait SinkExt<T>: Sink<T> {
fn send_and_flush(&mut self, item: T) -> impl Future<Output = Result<(), Self::Error>>;
}
impl<T, A> SinkExt<T> for A
where
A: Sink<T>,
{
async fn send_and_flush(&mut self, item: T) -> Result<(), Self::Error> {
Sink::<T>::send(self, item).await?;
Sink::<T>::flush(self).await
}
}