/// Write the blob to disk and set the correct file extension
/// returns the final name with the supplied extension
Write the blob to disk and set the correct file extension
returns the final name with the supplied extension
Write the blob to disk and set the correct file extension returns the final name with the supplied extension
pub async fn finalize(self, extension: &str) -> Result<String, std::io::Error> {
        self.file.sync_all().await?;
        let path = format!("{}/{}", &self.blob_dir, &self.blob_id);
        tokio::fs::rename(&path, format!("{}{}", &path, &extension)).await?;
        // Return with the extension
        Ok(format!("{}{}", &self.blob_id, &extension))
    }
pub async fn finalize ( self , extension : & str ) -> Result < String , std :: io :: Error > { self . file . sync_all ( ) . await ? ; let path = format ! ( " " self blob_dir self blob_id ) ; tokio :: fs :: rename ( & path , format ! ( " " path extension ) ) . await ? ; // Return with the extension Ok ( format ! ( " " self blob_id extension ) ) }
Write the blob to disk and set the correct file extension
returns the final name with the supplied extension
Write the blob to disk and set the correct file extension returns the final name with the supplied extension
self
extension
&str