pub async fn to_file_content(&self) -> Result<Vec<u8>, SafError> {
        // Not super efficient memory-wise, but doesn't block any threads
        let saf_file = self.clone();
        saf_file.verify_hash()?;
        // Block because gzipping could take some time
        tokio::task::spawn_blocking(move || {
            let data: SerializedBytes = saf_file.try_into()?;
            let mut enc = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default());
            use std::io::Write;
            enc.write_all(data.bytes())?;
            Ok(enc.finish()?)
        })
        .await
        .expect("blocking thread panic!d - panicing here too")
    }
/// Render this saf_file as bytecode to send over the wire, or store in a file.
Render this saf_file as bytecode to send over the wire, or store in a file.
Render this saf_file as bytecode to send over the wire or store in a file .
pub async fn to_file_content(&self) -> Result<Vec<u8>, SafError> {
        // Not super efficient memory-wise, but doesn't block any threads
        let saf_file = self.clone();
        saf_file.verify_hash()?;
        // Block because gzipping could take some time
        tokio::task::spawn_blocking(move || {
            let data: SerializedBytes = saf_file.try_into()?;
            let mut enc = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default());
            use std::io::Write;
            enc.write_all(data.bytes())?;
            Ok(enc.finish()?)
        })
        .await
        .expect("blocking thread panic!d - panicing here too")
    }
pub async fn to_file_content ( & self ) -> Result < Vec < u8 > , SafError > { // Not super efficient memory-wise, but doesn't block any threads let saf_file = self . clone ( ) ; saf_file . verify_hash ( ) ? ; // Block because gzipping could take some time tokio :: task :: spawn_blocking ( move | | { let data : SerializedBytes = saf_file . try_into ( ) ? ; let mut enc = flate2 :: write :: GzEncoder :: new ( Vec :: new ( ) , flate2 :: Compression :: default ( ) ) ; use std :: io :: Write ; enc . write_all ( data . bytes ( ) ) ? ; Ok ( enc . finish ( ) ? ) } ) . await . expect ( " " ) }
Render this saf_file as bytecode to send over the wire, or store in a file.
Render this saf_file as bytecode to send over the wire or store in a file .
&self
&self