Skip to main content

ProgressReporter

Trait ProgressReporter 

Source
pub trait ProgressReporter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn set_position(&self, position: u64);
    fn finish(&self);
}
Expand description

Receives byte-position updates from long-running transfers.

use marple_db::ProgressReporter;
use std::sync::atomic::{AtomicU64, Ordering};

struct Counter(AtomicU64);

impl ProgressReporter for Counter {
    fn set_position(&self, position: u64) {
        self.0.store(position, Ordering::Relaxed);
    }

    fn finish(&self) {}
}

Required Methods§

Source

fn set_position(&self, position: u64)

Sets the current byte position.

Source

fn finish(&self)

Marks the transfer as finished.

Implementors§