Skip to main content

Executer

Trait Executer 

Source
pub trait Executer: Send + Sync {
    // Required methods
    fn copy_file(&self, path: &Path) -> Result<PathBuf>;
    fn create_file(&self, path: &Path, content: String) -> Result<PathBuf>;
    fn copy_dir(&self, path: &Path) -> Result<()>;
    fn copy_template(&self, path: &Path, data: &Settings) -> Result<()>;
    fn copy_template_dir(&self, path: &Path, data: &Settings) -> Result<()>;
}

Required Methods§

Source

fn copy_file(&self, path: &Path) -> Result<PathBuf>

Copies a single file from the specified path.

§Errors

Returns an error if the file cannot be copied, such as if the path is invalid or if a file system error occurs.

Source

fn create_file(&self, path: &Path, content: String) -> Result<PathBuf>

Copies a single file from the specified path.

§Errors

Returns an error if the file cannot be copied, such as if the path is invalid or if a file system error occurs.

Source

fn copy_dir(&self, path: &Path) -> Result<()>

Copies an entire directory from the specified path.

§Errors

Returns an error if the directory cannot be copied, such as if the path is invalid or if a file system error occurs.

Source

fn copy_template(&self, path: &Path, data: &Settings) -> Result<()>

Copies a template file from the specified path, applying settings.

§Errors

Returns an error if the template cannot be copied or if any settings-related error occurs.

Source

fn copy_template_dir(&self, path: &Path, data: &Settings) -> Result<()>

Copies an entire template directory from the specified path, applying settings.

§Errors

Returns an error if the template directory cannot be copied or if any settings-related error occurs.

Implementors§