Skip to main content

BlockCloner

Trait BlockCloner 

Source
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§

Source

fn backend(&self) -> CloneBackend

Which primitive this implementation calls.

Source

fn clone_file(&self, source: &Path, destination: &Path) -> Result<()>

Clones one regular file. destination must not exist.

Source

fn clone_directory(&self, source: &Path, destination: &Path) -> Result<()>

Clones a whole directory hierarchy in one call. destination must not exist.

Source

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".

Implementors§