Skip to main content

WriteOperations

Trait WriteOperations 

Source
pub trait WriteOperations: Send + Sync {
    // Required methods
    fn write_file(&self, absolute_path: &Path, content: &str) -> Result<()>;
    fn mkdir(&self, dir: &Path) -> Result<()>;
}
Expand description

Pluggable operations for the write tool (matching pi’s WriteOperations). Override these to delegate file writing to remote systems (for example SSH).

Required Methods§

Source

fn write_file(&self, absolute_path: &Path, content: &str) -> Result<()>

Write content to a file.

Source

fn mkdir(&self, dir: &Path) -> Result<()>

Create directory recursively.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<F1, F2> WriteOperations for (F1, F2)
where F1: Send + Sync + Fn(&Path, &str) -> Result<()>, F2: Send + Sync + Fn(&Path) -> Result<()>,

Source§

fn write_file(&self, absolute_path: &Path, content: &str) -> Result<()>

Source§

fn mkdir(&self, dir: &Path) -> Result<()>

Implementors§