pub struct CopyBuffer<B, SR, SW> { /* private fields */ }
Expand description
A wrapper of its underlying buffer(array, vector, unix pipe…).
Implementations§
Source§impl<B, SR, SW> CopyBuffer<B, SR, SW>
impl<B, SR, SW> CopyBuffer<B, SR, SW>
Source§impl<B, SR, SW> CopyBuffer<B, SR, SW>where
B: Unpin,
SR: AsyncRead + AsyncWrite + Unpin,
SW: AsyncRead + AsyncWrite + Unpin,
CopyBuffer<B, SR, SW>: AsyncIOBuf,
impl<B, SR, SW> CopyBuffer<B, SR, SW>where
B: Unpin,
SR: AsyncRead + AsyncWrite + Unpin,
SW: AsyncRead + AsyncWrite + Unpin,
CopyBuffer<B, SR, SW>: AsyncIOBuf,
Sourcepub fn poll_copy(
&mut self,
cx: &mut Context<'_>,
r: &mut <CopyBuffer<B, SR, SW> as AsyncIOBuf>::StreamR,
w: &mut <CopyBuffer<B, SR, SW> as AsyncIOBuf>::StreamW,
) -> Poll<Result<u64>>
pub fn poll_copy( &mut self, cx: &mut Context<'_>, r: &mut <CopyBuffer<B, SR, SW> as AsyncIOBuf>::StreamR, w: &mut <CopyBuffer<B, SR, SW> as AsyncIOBuf>::StreamW, ) -> Poll<Result<u64>>
Copy data from reader to writer via buffer, asynchronously.
Trait Implementations§
Source§impl<'a, SR, SW> AsyncIOBuf for CopyBuffer<&'a mut Pipe, SR, SW>where
SR: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
SW: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
impl<'a, SR, SW> AsyncIOBuf for CopyBuffer<&'a mut Pipe, SR, SW>where
SR: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
SW: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
type StreamR = SR
type StreamW = SW
fn poll_read_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamR, ) -> Poll<Result<usize>>
fn poll_write_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<usize>>
fn poll_flush_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<()>>
Source§impl<B, SR, SW> AsyncIOBuf for CopyBuffer<B, SR, SW>
impl<B, SR, SW> AsyncIOBuf for CopyBuffer<B, SR, SW>
type StreamR = SR
type StreamW = SW
fn poll_read_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamR, ) -> Poll<Result<usize>>
fn poll_write_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<usize>>
fn poll_flush_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<()>>
Source§impl<SR, SW> AsyncIOBuf for CopyBuffer<Pipe, SR, SW>where
SR: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
SW: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
impl<SR, SW> AsyncIOBuf for CopyBuffer<Pipe, SR, SW>where
SR: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
SW: AsyncRead + AsyncWrite + AsyncRawIO + Unpin,
type StreamR = SR
type StreamW = SW
fn poll_read_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamR, ) -> Poll<Result<usize>>
fn poll_write_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<usize>>
fn poll_flush_buf( &mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW, ) -> Poll<Result<()>>
Auto Trait Implementations§
impl<B, SR, SW> Freeze for CopyBuffer<B, SR, SW>where
B: Freeze,
impl<B, SR, SW> RefUnwindSafe for CopyBuffer<B, SR, SW>
impl<B, SR, SW> Send for CopyBuffer<B, SR, SW>
impl<B, SR, SW> Sync for CopyBuffer<B, SR, SW>
impl<B, SR, SW> Unpin for CopyBuffer<B, SR, SW>
impl<B, SR, SW> UnwindSafe for CopyBuffer<B, SR, SW>
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