pub trait OperationObserver: Send + Sync {
// Provided methods
fn planned(&self, _plan: &OperationPlan) { ... }
fn hashing_started(&self) { ... }
fn hashing_finished(&self) { ... }
fn transfer_started(
&self,
_path: &Path,
_total_bytes: u64,
) -> Option<FileProgress> { ... }
fn file_finished(&self, _row: FileRow<'_>) { ... }
}Expand description
Hooks an operation calls as it runs. Called from worker threads, possibly concurrently; implementations serialize their own output.
Provided Methods§
Sourcefn planned(&self, _plan: &OperationPlan)
fn planned(&self, _plan: &OperationPlan)
Once, after selection and storage checks, before any transfer.
Sourcefn hashing_started(&self)
fn hashing_started(&self)
The first file that needs hashing is about to be hashed. Not called when nothing is hashed.
Sourcefn hashing_finished(&self)
fn hashing_finished(&self)
Hashing is done, once for every hashing_started, error exits included.
Sourcefn transfer_started(
&self,
_path: &Path,
_total_bytes: u64,
) -> Option<FileProgress>
fn transfer_started( &self, _path: &Path, _total_bytes: u64, ) -> Option<FileProgress>
A transfer of total_bytes for path is starting. The returned
callbacks receive byte deltas and the transfer’s success; None means
nobody is watching this transfer.
Sourcefn file_finished(&self, _row: FileRow<'_>)
fn file_finished(&self, _row: FileRow<'_>)
A file’s outcome is final, in completion order.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".