pub struct TransferProgress { /* private fields */ }Expand description
Progress display for rsync transfers.
Implementations§
Source§impl TransferProgress
impl TransferProgress
Sourcepub fn new(
ctx: OutputContext,
direction: TransferDirection,
label: impl Into<String>,
quiet: bool,
) -> Self
pub fn new( ctx: OutputContext, direction: TransferDirection, label: impl Into<String>, quiet: bool, ) -> Self
Create a new transfer progress display.
Sourcepub fn upload(ctx: OutputContext, label: impl Into<String>, quiet: bool) -> Self
pub fn upload(ctx: OutputContext, label: impl Into<String>, quiet: bool) -> Self
Convenience constructor for uploads.
Sourcepub fn download(
ctx: OutputContext,
label: impl Into<String>,
quiet: bool,
) -> Self
pub fn download( ctx: OutputContext, label: impl Into<String>, quiet: bool, ) -> Self
Convenience constructor for downloads.
Sourcepub fn update_from_line(&mut self, line: &str)
pub fn update_from_line(&mut self, line: &str)
Update progress from a raw rsync output line.
Sourcepub fn set_current_file(&mut self, path: impl Into<String>)
pub fn set_current_file(&mut self, path: impl Into<String>)
Set the current file being transferred.
Sourcepub fn set_compression_ratio(&mut self, ratio: f64)
pub fn set_compression_ratio(&mut self, ratio: f64)
Set compression ratio (e.g. 3.2 for 3.2:1).
Sourcepub fn apply_summary(&mut self, bytes_transferred: u64, files_transferred: u32)
pub fn apply_summary(&mut self, bytes_transferred: u64, files_transferred: u32)
Apply a final summary from an external source.
Useful when progress lines are unavailable (e.g., mock transport).
Sourcepub fn stats(&self) -> TransferStats
pub fn stats(&self) -> TransferStats
Snapshot current transfer stats for callers.
Sourcepub fn finish_error(&mut self, message: &str)
pub fn finish_error(&mut self, message: &str)
Finish with a failure message.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TransferProgress
impl RefUnwindSafe for TransferProgress
impl Send for TransferProgress
impl Sync for TransferProgress
impl Unpin for TransferProgress
impl UnsafeUnpin for TransferProgress
impl UnwindSafe for TransferProgress
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