Trait r_extcap::controls::asynchronous::util::AsyncReadExt

source ·
pub trait AsyncReadExt: AsyncRead + Unpin {
    // Provided method
    fn try_read_exact<'life0, 'async_trait, const N: usize>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Option<[u8; N]>>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Extension trait for AsyncRead.

Provided Methods§

source

fn try_read_exact<'life0, 'async_trait, const N: usize>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Option<[u8; N]>>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Reads the exact number of bytes, like read_exact, but returns None if it gets EOF at the start of the read. In other words, this is the “all or nothing” version of read.

Object Safety§

This trait is not object safe.

Implementors§