impl<'a, R> Future for FillBuf<'a, R> where
R: AsyncBufRead + ?Sized + Unpin,
{ type Output = io::Result<&'a [u8]>;
fn poll(mutself: Pin<&mutSelf>, cx: &mut Context<'_>) -> Poll<Self::Output> { let this = &mut *self; let reader = this.reader.take().expect("Polled FillBuf after completion");
match Pin::new(&mut *reader).poll_fill_buf(cx) { // With polonius it is possible to remove this inner match and just have the correct // lifetime of the reference inferred based on which branch is taken
Poll::Ready(Ok(_)) => match Pin::new(reader).poll_fill_buf(cx) {
Poll::Ready(Ok(slice)) => Poll::Ready(Ok(slice)),
Poll::Ready(Err(err)) => {
unreachable!("reader indicated readiness but then returned an error: {:?}", err)
}
Poll::Pending => {
unreachable!("reader indicated readiness but then returned pending")
}
},
Poll::Ready(Err(err)) => Poll::Ready(Err(err)),
Poll::Pending => {
this.reader = Some(reader);
Poll::Pending
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.