Expand description
Crate for syncing files between (theoretically) arbitrary sources. For example, syncing local files to an S3 bucket.
§Example
use filesync::{
local::LocalFiles,
s3::S3Files,
};
let config = aws_config::load_from_env().await;
let client = aws_sdk_s3::Client::new(&config);
let mut local = LocalFiles::new("./my_local_files", true);
let mut s3 = S3Files::new(client, "my_s3_bucket", "path/in/bucket", true);
let synced_paths = filesync::sync_one_way(&mut local, &mut s3).await?;
assert_eq!(synced_paths, vec![PathBuf::from("my_changed_file.txt")]);
Modules§
- local
- Provides a FileSource for local files on disk.
- s3
- Provides a FileSource for a path in an S3 bucket.
Structs§
- File
Entry - Represents a file at a path with some metadata.
Enums§
- Sync
Error - Error type for this crate.
Traits§
- File
Source - The trait that powers the sync function. Implemented using the async_trait crate.
Functions§
- sync_
one_ way - Sync any new or modified files from one
FileSource
to another.
Type Aliases§
- Result
- General result type for this crate.