use futures_core::ready; use futures_core::task::{Context, Poll}; use futures_io::{AsyncBufRead, AsyncRead, IoSliceMut}; use pin_project_lite::pin_project; use std::fmt; use std::io; use std::pin::Pin;
pin_project! { /// Reader for the [`chain`](super::AsyncReadExt::chain) method. #[must_use = "readers do nothing unless polled"] pubstruct Chain<T, U> { #[pin]
first: T, #[pin]
second: U,
done_first: bool,
}
}
/// Gets references to the underlying readers in this `Chain`. pubfn get_ref(&self) -> (&T, &U) {
(&self.first, &self.second)
}
/// Gets mutable references to the underlying readers in this `Chain`. /// /// Care should be taken to avoid modifying the internal I/O state of the /// underlying readers as doing so may corrupt the internal state of this /// `Chain`. pubfn get_mut(&mutself) -> (&mut T, &tyle='color:red'>mut U) {
(&mutself.first, &mutself.second)
}
/// Gets pinned mutable references to the underlying readers in this `Chain`. /// /// Care should be taken to avoid modifying the internal I/O state of the /// underlying readers as doing so may corrupt the internal state of this /// `Chain`. pubfn get_pin_mut(self: Pin<&mutSelf>) -> (Pin<&mut T>, Pin<&mut U>) { let this = self.project();
(this.first, this.second)
}
/// Consumes the `Chain`, returning the wrapped readers. pubfn into_inner(self) -> (T, U) {
(self.first, self.second)
}
}
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.