fn read_until_full(stream: &mut File, buf: &mut [u8]) -> Result<usize, Error> {
    let mut nb = 0;
    loop {
        match stream.read(&mut buf[nb..]) {
            Ok(0) => return Ok(nb),
            Ok(n) => nb += n,
            Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
            Err(e) => return Err(e),
        }
    }
}
/// Calls read until the buffer is full or EOF.
Calls read until the buffer is full or EOF.
Calls read until the buffer is full or EOF .
fn read_until_full(stream: &mut File, buf: &mut [u8]) -> Result<usize, Error> {
    let mut nb = 0;
    loop {
        match stream.read(&mut buf[nb..]) {
            Ok(0) => return Ok(nb),
            Ok(n) => nb += n,
            Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
            Err(e) => return Err(e),
        }
    }
}
fn read_until_full ( stream : & mut File , buf : & mut [ u8 ] ) -> Result < usize , Error > { let mut nb = 0 ; loop { match stream . read ( & mut buf [ nb .. ] ) { Ok ( 0 ) => return Ok ( nb ) , Ok ( n ) => nb += n , Err ( ref e ) if e . kind ( ) == ErrorKind :: Interrupted => continue , Err ( e ) => return Err ( e ) , } } }
Calls read until the buffer is full or EOF.
Calls read until the buffer is full or EOF .
stream
&mut File
buf
&mut [u8]
stream
&mut File
buf
&mut [u8]