some writers may need to be flushed to write out all data
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Ok(put)
}
+/// awaitable version of 'poll_flush'.
+async fn flush<T: SeqWrite + ?Sized>(
+ output: &mut T,
+) -> io::Result<()> {
+ poll_fn(|cx| unsafe { Pin::new_unchecked(&mut *output).poll_flush(cx) }).await
+}
+
/// Write the entire contents of a buffer, handling short writes.
async fn seq_write_all<T: SeqWrite + ?Sized>(
output: &mut T,
)
.await?;
+ flush(self.output.as_mut()).await?;
+
// done up here because of the self-borrow and to propagate
let end_offset = self.position();