pub(crate) struct Rewind<T> {
pre: Option<Bytes>,
inner: T,
}
Expand description
Combine a buffer with an IO, rewinding reads to use the buffer.
Fields§
§pre: Option<Bytes>
§inner: T
Implementations§
Source§impl<T> Rewind<T>
impl<T> Rewind<T>
pub(crate) fn new_buffered(io: T, buf: Bytes) -> Self
pub(crate) fn into_inner(self) -> (T, Bytes)
Trait Implementations§
Source§impl<T> Write for Rewind<T>
impl<T> Write for Rewind<T>
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the destination. Read moreSource§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>
Like
poll_write
, except that it writes from a slice of buffers.Source§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to flush the object. Read more
Source§fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to shut down this writer.
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Returns whether this writer has an efficient
poll_write_vectored
implementation. Read moreAuto Trait Implementations§
impl<T> !Freeze for Rewind<T>
impl<T> RefUnwindSafe for Rewind<T>where
T: RefUnwindSafe,
impl<T> Send for Rewind<T>where
T: Send,
impl<T> Sync for Rewind<T>where
T: Sync,
impl<T> Unpin for Rewind<T>where
T: Unpin,
impl<T> UnwindSafe for Rewind<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more