pub struct WriteFullyFuture<'a, O>where
O: AsyncOutput + ?Sized,{ /* private fields */ }Expand description
Future that writes every item from its source slice.
Items accepted before cancellation remain written. The accepted count is
observable through Self::items_written.
To preserve executor fairness, one outer poll performs a bounded number of
successful inner writes. The future self-wakes and returns Poll::Pending
when that budget is exhausted before completion.
§Panics
Future::poll panics when called again after this future has returned
Poll::Ready.
§Type Parameters
'a: Shared lifetime of the output borrow and source slice.O: Asynchronous output type.
Implementations§
Source§impl<'a, O> WriteFullyFuture<'a, O>where
O: AsyncOutput + ?Sized,
impl<'a, O> WriteFullyFuture<'a, O>where
O: AsyncOutput + ?Sized,
Trait Implementations§
Source§impl<O> Future for WriteFullyFuture<'_, O>where
O: AsyncOutput + ?Sized,
impl<O> Future for WriteFullyFuture<'_, O>where
O: AsyncOutput + ?Sized,
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Polls the write-fully operation.
§Parameters
cx: Task context used to register a wake-up.
§Returns
Returns Poll::Pending while more output capacity is needed, or
Poll::Ready after all items are written or an error occurs.
§Errors
Returns ErrorKind::WriteZero if the output accepts no item before
completion. Other errors are propagated from the output.
§Panics
Panics when polled after returning Poll::Ready.