// Writes the protobuf serialization of the artifact into a file in the given
// directory.
Writes the protobuf serialization of the artifact into a file in the given
directory.
Writes the protobuf serialization of the artifact into a file in the given directory .
fn write_to_disk(&self, path: &Path) -> Result<(), std::io::Error> {
        let (file_directory, file_name) = self.file_location(path);
        // Create the path if necessary.
        fs::create_dir_all(&file_directory)?;
        let full_path = file_directory.join(file_name);
        // If the file exists, it will be overwritten (this is required on
        // intializations).
        let serialized = self.serialize()?;
        ic_utils::fs::write_using_tmp_file(full_path, |writer| writer.write_all(&serialized))
    }
fn write_to_disk ( & self , path : & Path ) -> Result < ( ) , std :: io :: Error > { let ( file_directory , file_name ) = self . file_location ( path ) ; // Create the path if necessary. fs :: create_dir_all ( & file_directory ) ? ; let full_path = file_directory . join ( file_name ) ; // If the file exists, it will be overwritten (this is required on // intializations). let serialized = self . serialize ( ) ? ; ic_utils :: fs :: write_using_tmp_file ( full_path , | writer | writer . write_all ( & serialized ) ) }
Writes the protobuf serialization of the artifact into a file in the given
directory.
Writes the protobuf serialization of the artifact into a file in the given directory .
&self
path
&Path