[][src]Trait async_peek::AsyncPeek

pub trait AsyncPeek {
    fn poll_peek(
        self: Pin<&mut Self>,
        ctx: &mut Context<'_>,
        buf: &mut [u8]
    ) -> Poll<Result<usize, Error>>; }

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>>

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.

Loading content...

Implementations on Foreign Types

impl<'_> AsyncPeek for &'_ [u8][src]

impl<T: ?Sized, '_> AsyncPeek for &'_ mut T where
    T: AsyncPeek + Unpin
[src]

impl<T: ?Sized> AsyncPeek for Box<T> where
    T: AsyncPeek + Unpin
[src]

impl<T> AsyncPeek for Pin<T> where
    T: DerefMut + Unpin,
    <T as Deref>::Target: AsyncPeek
[src]

Loading content...

Implementors

Loading content...