pub struct TransferObserver<F>(pub F);Expand description
Adapts an on_file_start callback (the pre-observer progress API) into an
observer that only watches transfers.
Tuple Fields§
§0: FTrait Implementations§
Source§impl<F> OperationObserver for TransferObserver<F>
impl<F> OperationObserver for TransferObserver<F>
Source§fn 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.Source§fn planned(&self, _plan: &OperationPlan)
fn planned(&self, _plan: &OperationPlan)
Once, after selection and storage checks, before any transfer.
Source§fn hashing_started(&self)
fn hashing_started(&self)
The first file that needs hashing is about to be hashed. Not called
when nothing is hashed.
Source§fn hashing_finished(&self)
fn hashing_finished(&self)
Hashing is done, once for every
hashing_started, error exits included.Source§fn file_finished(&self, _row: FileRow<'_>)
fn file_finished(&self, _row: FileRow<'_>)
A file’s outcome is final, in completion order.
Auto Trait Implementations§
impl<F> Freeze for TransferObserver<F>where
F: Freeze,
impl<F> RefUnwindSafe for TransferObserver<F>where
F: RefUnwindSafe,
impl<F> Send for TransferObserver<F>where
F: Send,
impl<F> Sync for TransferObserver<F>where
F: Sync,
impl<F> Unpin for TransferObserver<F>where
F: Unpin,
impl<F> UnsafeUnpin for TransferObserver<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for TransferObserver<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more