pub fn persist(&self) -> Result<PathBuf, Box<dyn Error + 'static>> {
    let uuid = Uuid::new_v4().to_hyphenated().to_string();
    let tmp_dir = env::temp_dir();
    let file_name = format!("report-{}.toml", &uuid);
    let file_path = Path::new(&tmp_dir).join(file_name);
    let mut file = File::create(&file_path)?;
    let toml = self.serialize().unwrap();
    file.write_all(toml.as_bytes())?;
    Ok(file_path)
  }
/// Write a file to disk.
Write a file to disk.
Write a file to disk .
pub fn persist(&self) -> Result<PathBuf, Box<dyn Error + 'static>> {
    let uuid = Uuid::new_v4().to_hyphenated().to_string();
    let tmp_dir = env::temp_dir();
    let file_name = format!("report-{}.toml", &uuid);
    let file_path = Path::new(&tmp_dir).join(file_name);
    let mut file = File::create(&file_path)?;
    let toml = self.serialize().unwrap();
    file.write_all(toml.as_bytes())?;
    Ok(file_path)
  }
pub fn persist ( & self ) -> Result < PathBuf , Box < dyn Error + ' static > > { let uuid = Uuid :: new_v4 ( ) . to_hyphenated ( ) . to_string ( ) ; let tmp_dir = env :: temp_dir ( ) ; let file_name = format ! ( " " uuid ) ; let file_path = Path :: new ( & tmp_dir ) . join ( file_name ) ; let mut file = File :: create ( & file_path ) ? ; let toml = self . serialize ( ) . unwrap ( ) ; file . write_all ( toml . as_bytes ( ) ) ? ; Ok ( file_path ) }
Write a file to disk.
Write a file to disk .
&self
&self