[−][src]Trait async_peek::AsyncPeek
Read data asynchronously without removing it from the queue.
Required methods
fn poll_peek(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
Attempts to read data into buf
without removing it from the queue.
Returns the number of bytes read on success, or io::Error
if an error is encountered.
If no data is available, the current task is registered to be notified when data becomes
available or the stream is closed, and Poll::Pending
is returned.
Implementations on Foreign Types
impl<'_> AsyncPeek for &'_ [u8]
[src]
fn poll_peek(
self: Pin<&mut Self>,
_: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
_: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
impl<T: ?Sized, '_> AsyncPeek for &'_ mut T where
T: AsyncPeek + Unpin,
[src]
T: AsyncPeek + Unpin,
fn poll_peek(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
impl<T: ?Sized> AsyncPeek for Box<T> where
T: AsyncPeek + Unpin,
[src]
T: AsyncPeek + Unpin,
fn poll_peek(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
impl<T> AsyncPeek for Pin<T> where
T: DerefMut + Unpin,
<T as Deref>::Target: AsyncPeek,
[src]
T: DerefMut + Unpin,
<T as Deref>::Target: AsyncPeek,
fn poll_peek(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>