async_compression/generic/write/
buf_write.rs

1use super::Buffer;
2use std::{
3    io,
4    pin::Pin,
5    task::{Context, Poll},
6};
7
8pub(crate) trait AsyncBufWrite {
9    /// Attempt to return an internal buffer to write to, flushing data out to the inner reader if
10    /// it is full.
11    ///
12    /// On success, returns `Poll::Ready(Ok(buf))`.
13    ///
14    /// If the buffer is full and cannot be flushed, the method returns `Poll::Pending` and
15    /// arranges for the current task context (`cx`) to receive a notification when the object
16    /// becomes readable or is closed.
17    fn poll_partial_flush_buf(
18        self: Pin<&mut Self>,
19        cx: &mut Context<'_>,
20    ) -> Poll<io::Result<Buffer<'_>>>;
21}