fn read_file_bytes(path: &PathBuf) -> Result<Bytes> {
        let file         = File::open(&path)?;
        let mut reader   = BufReader::new(file);
        let mut contents = Vec::new();

        reader.read_to_end(&mut contents)?;

        Ok(Bytes::from(contents))
    }
// Read a file's contents into Bytes
Read a file's contents into Bytes
Read a file ' s contents into Bytes
fn read_file_bytes(path: &PathBuf) -> Result<Bytes> {
        let file         = File::open(&path)?;
        let mut reader   = BufReader::new(file);
        let mut contents = Vec::new();
        reader.read_to_end(&mut contents)?;
        Ok(Bytes::from(contents))
    }
fn read_file_bytes ( path : & PathBuf ) -> Result < Bytes > { let file = File :: open ( & path ) ? ; let mut reader = BufReader :: new ( file ) ; let mut contents = Vec :: new ( ) ; reader . read_to_end ( & mut contents ) ? ; Ok ( Bytes :: from ( contents ) ) }
Read a file's contents into Bytes
Read a file ' s contents into Bytes
path
&PathBuf
path
&PathBuf