Crates.io | librsync-ffi |
lib.rs | librsync-ffi |
version | 0.1.0 |
source | src |
created_at | 2020-04-07 09:11:15.125607 |
updated_at | 2020-04-07 09:11:15.125607 |
description | opinionated bindings to librsync |
homepage | |
repository | |
max_upload_size | |
id | 227213 |
size | 17,038 |
Dynamically linked to librsync2 / librsync-dev
Signatures are stored in memory even though the whole file api is used. Temporary directories are utilized to hold values until they get initialized in memory.
let path = PathBuf::from("some/file/location");
let (signature, stats) = Signature::new(&path).unwrap;
Delta files are a Vec<u8>
representations of rsync delta files. A delta takes a file signature and some new
file to compute against
let path = PathBuf::from("some/file/location");
let (signature, stats) = Signature::new(&path).unwrap;
let some_new_path = PathBuf::from("the/file/changed/maybe");
let (delta, stats) = Delta::new(&mut signature, &some_new_path);
let path = PathBuf::from("some/file/location");
let (signature, stats) = Signature::new(&path).unwrap;
let some_new_path = PathBuf::from("the/file/changed/maybe");
let (delta, stats) = Delta::new(&mut signature, &some_new_path);
// will output the value of the new file as a Vec<u8>
let new_file = patch_file(&path, delta);