pub trait BlockCloner {
// Required methods
fn backend(&self) -> CloneBackend;
fn clone_file(&self, source: &Path, destination: &Path) -> Result<()>;
fn clone_directory(&self, source: &Path, destination: &Path) -> Result<()>;
fn clones_directories(&self) -> bool;
}Expand description
Materialises a path by sharing the source’s disk blocks rather than copying them.
Required Methods§
Sourcefn backend(&self) -> CloneBackend
fn backend(&self) -> CloneBackend
Which primitive this implementation calls.
Sourcefn clone_file(&self, source: &Path, destination: &Path) -> Result<()>
fn clone_file(&self, source: &Path, destination: &Path) -> Result<()>
Clones one regular file. destination must not exist.
Sourcefn clone_directory(&self, source: &Path, destination: &Path) -> Result<()>
fn clone_directory(&self, source: &Path, destination: &Path) -> Result<()>
Clones a whole directory hierarchy in one call. destination must not exist.
Sourcefn clones_directories(&self) -> bool
fn clones_directories(&self) -> bool
Whether clone_directory is cheaper than descending file by file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".