[][src]Struct folder_compare::FolderCompare

pub struct FolderCompare {
    pub changed_files: Vec<PathBuf>,
    pub new_files: Vec<PathBuf>,
}

Fields

changed_files: Vec<PathBuf>new_files: Vec<PathBuf>

Implementations

impl FolderCompare[src]

pub fn new(
    path1: &Path,
    path2: &Path,
    excluded: &Vec<String>
) -> Result<Self, Error>
[src]

Instantiates an object of FolderCompare and does the comparison between two Path directories and delivers itself consisting of two lists of PathBuf containing changed and new (only existing in first Directory) files. It takes a Vec<&str> as argument for excluding specific substrings in the path (e.g. file extensions like .txt).

Example

The following code recursively iterates over two directories and returns lists of changed and new files

 use std::path::Path;
 use folder_compare;
 use folder_compare::FolderCompare;


 let excluded = vec![".doc".to_string(), ".txt".to_string()];

 let result = FolderCompare::new(Path::new("/tmp/a"), Path::new("/tmp/b"), &excluded).unwrap();

 let changed_files = result.changed_files;
 let new_filed = result.new_files;

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.