pub trait SyncProgressCallback: Send {
// Required method
fn on_progress(
&self,
batch_complete: usize,
total_pulled: usize,
has_more: bool,
);
}Available on crate feature
sync only.Expand description
Callback for reporting sync progress during initial catchup.
Implement this trait to receive updates as batches of changes are pulled and applied during initial sync.
§Example
use pulsedb::sync::progress::SyncProgressCallback;
struct ProgressBar;
impl SyncProgressCallback for ProgressBar {
fn on_progress(&self, batch_complete: usize, total_pulled: usize, has_more: bool) {
println!("Pulled {} changes (batch of {}), more: {}", total_pulled, batch_complete, has_more);
}
}Required Methods§
Sourcefn on_progress(
&self,
batch_complete: usize,
total_pulled: usize,
has_more: bool,
)
fn on_progress( &self, batch_complete: usize, total_pulled: usize, has_more: bool, )
Called after each batch of changes is pulled and applied.
§Arguments
batch_complete— Number of changes in the batch just appliedtotal_pulled— Cumulative count of all changes pulled so farhas_more— Whether the remote has more changes to send