// Read the contents of a file at the given `relative_path` as bytes
Read the contents of a file at the given `relative_path` as bytes
Read the contents of a file at the given ` relative_path ` as bytes
pub async fn read_file_bytes<P: AsRef<Path>>(&self, relative_path: P) -> Result<Vec<u8>> {
        let path = self.path.join(relative_path.as_ref());
        let relative_path = match relative_path.as_ref().to_str() {
            Some(relative_path) => relative_path,
            None => return Err(format_err!("Relative path is not valid unicode")),
        };
        let proxy =
            match open_file_no_describe(&self.proxy, relative_path, fio::OPEN_RIGHT_READABLE) {
                Ok(proxy) => proxy,
                Err(e) => {
                    return Err(format_err!(
                        "Could not open file `{}`: {}",
                        path.as_path().display(),
                        e
                    ))
                }
            };
        match read(&proxy).await {
            Ok(data) => Ok(data),
            Err(e) => Err(format_err!("Could not read file `{}`: {}", path.as_path().display(), e)),
        }
    }
pub async fn read_file_bytes < P : AsRef < Path > > ( & self , relative_path : P ) -> Result < Vec < u8 > > { let path = self . path . join ( relative_path . as_ref ( ) ) ; let relative_path = match relative_path . as_ref ( ) . to_str ( ) { Some ( relative_path ) => relative_path , None => return Err ( format_err ! ( " " ) ) , } ; let proxy = match open_file_no_describe ( & self . proxy , relative_path , fio :: OPEN_RIGHT_READABLE ) { Ok ( proxy ) => proxy , Err ( e ) => { return Err ( format_err ! ( " " path as_path ( ) display ( ) e ) ) } } ; match read ( & proxy ) . await { Ok ( data ) => Ok ( data ) , Err ( e ) => Err ( format_err ! ( " " path as_path ( ) display ( ) e ) ) , } }
Read the contents of a file at the given `relative_path` as bytes
Read the contents of a file at the given ` relative_path ` as bytes
&self
relative_path
P