pub fn open<P: AsRef<Path>>(path: P) -> io::Result<InMemoryFile> {
        let file = File::open(path.as_ref())?;
        let mut reader = BufReader::new(file);
        let mut bytes: Vec<u8> = vec![];
        let size: usize = reader.read_to_end(&mut bytes)?;

        let stats = FileStats {
            size,
            access_count: 0,
            priority: 0,
        };

        Ok(InMemoryFile { bytes, stats })
    }
/// Reads the file at the path into an InMemoryFile.
Reads the file at the path into an InMemoryFile.
Reads the file at the path into an InMemoryFile .
pub fn open<P: AsRef<Path>>(path: P) -> io::Result<InMemoryFile> {
        let file = File::open(path.as_ref())?;
        let mut reader = BufReader::new(file);
        let mut bytes: Vec<u8> = vec![];
        let size: usize = reader.read_to_end(&mut bytes)?;
        let stats = FileStats {
            size,
            access_count: 0,
            priority: 0,
        };
        Ok(InMemoryFile { bytes, stats })
    }
pub fn open < P : AsRef < Path > > ( path : P ) -> io :: Result < InMemoryFile > { let file = File :: open ( path . as_ref ( ) ) ? ; let mut reader = BufReader :: new ( file ) ; let mut bytes : Vec < u8 > = vec ! [ ] ; let size : usize = reader . read_to_end ( & mut bytes ) ? ; let stats = FileStats { size , access_count : 0 , priority : 0 , } ; Ok ( InMemoryFile { bytes , stats } ) }
Reads the file at the path into an InMemoryFile.
Reads the file at the path into an InMemoryFile .
path
P
path
P