[−][src]Crate rusync
rusync
Implements copy from one directory to an other
To use rusync as a library, start with the Syncer struct.
To customize its output, implement the ProgressInfo trait.
Example
let console_info = rusync::ConsoleProgressInfo::new(); // or any struct that implements the ProgressInfo trait let options = rusync::SyncOptions::new(); // can set any public field of SyncOptions here let source = std::path::Path::new("src"); let destination = std::path::Path::new("dest"); let syncer = rusync::Syncer::new(&source, &destination, options, Box::new(console_info)); let stats = syncer.sync(); match stats { Err(err) => { eprintln!("Error when syncing: {}", err); } Ok(stats) => { println!("Transfered {} files", stats.copied); } }
Re-exports
pub use crate::console_info::ConsoleProgressInfo; |
pub use crate::sync::Stats; |
pub use crate::sync::SyncOptions; |
pub use crate::sync::Syncer; |
Modules
console_info | console_info |
progress | |
sync |