pub fn load(&self, id: &str) -> Result<Vec<u8>> {
        let mut f = File::open(self.filename(id))?;
        let data = decompress(&mut f)?;
        #[cfg(os = "linux")]
        fadvise::dontneed(f);

        if data.len() != CHUNKSZ {
            Err(Error::Missized(data.len()))
        } else {
            Ok(data)
        }
    }
/// Loads compressed chunk identified by `id`. The chunk is decompressed
/// on the fly and returned as raw data.
///
/// # Errors
///
/// Fails with Error::Missized if decompressed data does not fix exactly into a chunk.
Loads compressed chunk identified by `id`. The chunk is decompressed
on the fly and returned as raw data.
Loads compressed chunk identified by ` id ` . The chunk is decompressed on the fly and returned as raw data .
pub fn load(&self, id: &str) -> Result<Vec<u8>> {
        let mut f = File::open(self.filename(id))?;
        let data = decompress(&mut f)?;
        #[cfg(os = "linux")]
        fadvise::dontneed(f);
        if data.len() != CHUNKSZ {
            Err(Error::Missized(data.len()))
        } else {
            Ok(data)
        }
    }
pub fn load ( & self , id : & str ) -> Result < Vec < u8 > > { let mut f = File :: open ( self . filename ( id ) ) ? ; let data = decompress ( & mut f ) ? ; # [ cfg ( os " " ) ] fadvise :: dontneed ( f ) ; if data . len ( ) != CHUNKSZ { Err ( Error :: Missized ( data . len ( ) ) ) } else { Ok ( data ) } }
Loads compressed chunk identified by `id`.
Loads compressed chunk identified by ` id ` .
&self
id
&str
&self
id
&str
errors
Fails with Error::Missized if decompressed data does not fix exactly into a chunk.
Fails with Error :: Missized if decompressed data does not fix exactly into a chunk .