You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reader.rs
    path of file: ./repos/IBKR-API-Rust/src/core
    
    the code of the file until where you have to start completion: //! Reads and processes messages from the TCP socket
use std::io::Read;
use std::net::Shutdown;
use
    
    fn _recv_all_msg(&mut self) -> Result<Vec<u8>, IBKRApiLibError> {
        let mut cont = true;
        let mut allbuf: Vec<u8> = Vec::new();
        const NUM_BYTES: usize = 4096;

        while cont {
            let mut buf: [u8; NUM_BYTES] = [0; NUM_BYTES];

            let bytes_read = self
                .stream
                .read(&mut buf)
                .expect("Couldnt read from reader...");
            allbuf.extend_from_slice(&buf[0..bytes_read]);
            //logger.debug("len %d raw:%s|", len(buf), buf)

            if bytes_read < NUM_BYTES {
                cont = false;
            }
        }
        Ok(allbuf)
    }