fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<()>, _>(ReadExact::new(self, buf))
    }
/// Creates a future which will read exactly enough bytes to fill `buf`,
/// returning an error if end of file (EOF) is hit sooner.
///
/// The returned future will resolve once the read operation is completed.
///
/// In the case of an error the buffer and the object will be discarded, with
/// the error yielded.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::io::{AsyncReadExt, Cursor};
///
/// let mut reader = Cursor::new([1, 2, 3, 4]);
/// let mut output = [0u8; 4];
///
/// reader.read_exact(&mut output).await?;
///
/// assert_eq!(output, [1, 2, 3, 4]);
/// # Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
/// ```
///
/// ## EOF is hit before `buf` is filled
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::io::{self, AsyncReadExt, Cursor};
///
/// let mut reader = Cursor::new([1, 2, 3, 4]);
/// let mut output = [0u8; 5];
///
/// let result = reader.read_exact(&mut output).await;
///
/// assert_eq!(result.unwrap_err().kind(), io::ErrorKind::UnexpectedEof);
/// # });
/// ```
Creates a future which will read exactly enough bytes to fill `buf`,
returning an error if end of file (EOF) is hit sooner.

The returned future will resolve once the read operation is completed.

In the case of an error the buffer and the object will be discarded, with
the error yielded.
Creates a future which will read exactly enough bytes to fill ` buf ` returning an error if end of file ( EOF ) is hit sooner . The returned future will resolve once the read operation is completed . In the case of an error the buffer and the object will be discarded with the error yielded .
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<()>, _>(ReadExact::new(self, buf))
    }
fn read_exact < ' a > ( & ' a mut self , buf : & ' a mut [ u8 ] ) -> ReadExact < ' a , Self > where Self : Unpin , { assert_future :: < Result < ( ) > , _ > ( ReadExact :: new ( self , buf ) ) }
Creates a future which will read exactly enough bytes to fill `buf`,
returning an error if end of file (EOF) is hit sooner.
Creates a future which will read exactly enough bytes to fill ` buf ` returning an error if end of file ( EOF ) is hit sooner .
&'a mut self
buf
&'a mut [u8]
&'a mut self
buf
&'a mut [u8]
examples
None
futures::executor::block_on(async {
use futures::io::{AsyncReadExt, Cursor}.



reader.read_exact(&mut output).await?.


use futures :: io :: { AsyncReadExt Cursor } . reader . read_exact ( &mut output ) . await? .
ok::<(), box<dyn std::error::error>>(()) }).unwrap();
None
eof is hit before `buf` is filled
None
futures::executor::block_on(async {
use futures::io::{self, AsyncReadExt, Cursor}.



let result = reader.read_exact(&mut output).await.

assert_eq!(result.unwrap_err().kind(), io::ErrorKind::UnexpectedEof).
use futures :: io :: { self AsyncReadExt Cursor } . let result = reader . read_exact ( &mut output ) . await . assert_eq! ( result . unwrap_err () . kind () io :: ErrorKind :: UnexpectedEof ) .
});
None