optra 0.1.0

An engine for remote file synchronization
docs.rs failed to build optra-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: optra-0.2.1

Optra

Build Status

Optra is a Rust package allowing for remote file synchronization. It provides the algorithms necessary to keep files in sync, but not the transmission or file change detection needed. These are provided by wamp-rs and rdiff respectively, or you can use your own mechanism.

Optra currently requires nightly rust to build, because it uses in place insertion into linked lists, which is feature gated (see the docs) for more.

Optra is licensed using the MIT license (see LICENSE)

Documentation

Usage

The engine is based on the Admissabilty Based Sequence Transformation algorithm (doi: 10.1109/TPDS.2010.64), which is a type of Operational Transformation. The idea is that each site that wants to have a file synchronized will have an instance of Engine running. Any changes that are made to teh file should be run through the engine using either process_diffs() or process_transaction() prior to being broadcast. Any changes that are made at a remote site should be run through the engine using integrate_remote() prior to being applied to the file.

This crate generally works well with rdiff, but can work with any system that generates difference operations that are limited to insert and delete.

Examples

Assuming you have a method read_transaction for reading transactions from remote sites, the process for integrating remote changes onto a local file go like this:


let mut remote_sequence = read_transaction();
engine.integrate_remote(&mut remote_sequence);
remote_sequence.apply("local_file").unwrap();

On the other hand, if you have a Diff generated by detecting differences to a local file, you can process the diff and then send it out (assuming you have a method called send_transaction())

let diffs = file_hashes.diff_and_update(File::open("local_file").unwrap()).unwrap();
let transaction = engine.process_diffs(diffs);
send_transaction(transaction);