Skip to main content

materialize_with_files

Function materialize_with_files 

Source
pub fn materialize_with_files(
    src: &str,
    files: &HashMap<String, String>,
) -> Result<(PathBuf, Box<dyn FnOnce() + Send>), FilesError>
Expand description

Copies src into a fresh 0700 temp directory and writes files into it (0600), so nothing lands in the user’s repository. cleanup is always safe to call.

§Errors

Returns FilesError::CreateTempDir if creating the temp directory fails, FilesError::Copy if copying src fails, or FilesError::Write if writing a generated file fails.