[][src]Crate hm

This module generally takes ManagedObjects and either links them to their destination, or threads off and executes the task solution.

Modules

config

Define our Config and Worker. Implement how to take the config.toml and turn it into a Config { files: Vec<ManagedObject> }. Describes the Worker object, which is how we communicate back to our main() thread about how our task is going.

hmerror

Custom Error implementation to allow for our own kind, along with run-of-the-mill std::io::Errors.

util

Functions

get_task_batches

Create a non-cyclical dependency graph and give it back as a Vec<Vec<ManagedObject>>. Will return a CyclicalDependencyError if the graph is unsolveable. Intended to be used with either mgmt::execute_solution or mgmt::send_tasks_off_to_college.

perform_operation_on

Pretty simple. We currently support only symlinking, but copying would be trivial. Hand off to the actual function that does the work.

send_tasks_off_to_college

Take a ManagedObject task, an mpsc tx, and a Progressbar. Execute task and regularly inform the rx (all the way over back in main())about our status using config::Worker.

symlink_file

Either create a symlink to a file or directory. Generally we'll be doing this in a tilde'd home subdirectory, so we need to be careful to get our Path right.