Struct dircpy_stable::CopyBuilder[][src]

pub struct CopyBuilder {
    pub source: PathBuf,
    pub destination: PathBuf,
    // some fields omitted

Recursively copy a directory from a to b.

use dircpy::*;

// Most basic example:
copy_dir("src", "dest");

// Simple builder example:
CopyBuilder::new("src", "dest")

// Copy recursively, only including certain files:
CopyBuilder::new("src", "dest")


source: PathBuf

The source directory

destination: PathBuf

the destination directory


impl CopyBuilder[src]

pub fn new<P: AsRef<Path>, Q: AsRef<Path>>(source: P, dest: Q) -> CopyBuilder[src]

Construct a new CopyBuilder with source and dest.

pub fn overwrite(self, overwrite: bool) -> CopyBuilder[src]

Overwrite target files (off by default)

pub fn overwrite_if_newer(self, overwrite_only_newer: bool) -> CopyBuilder[src]

Overwrite if the source is newer (off by default)

pub fn overwrite_if_size_differs(
    overwrite_if_size_differs: bool
) -> CopyBuilder

Overwrite if size between source and dest differs (off by default)

pub fn with_exclude_filter(self, f: &str) -> CopyBuilder[src]

Do not copy files that contain this string

pub fn with_include_filter(self, f: &str) -> CopyBuilder[src]

Only copy files that contain this string.

pub fn run(&self) -> Result<(), Error>[src]

Execute the copy operation

Trait Implementations

impl Clone for CopyBuilder[src]

impl Debug for CopyBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.