pub trait ProgressCallback: Send + Sync {
// Required methods
fn inc(&self, n: u64);
fn parsing_started(&self, path: &str);
}Expand description
Trait for receiving progress updates during data parsing.
Implement this trait to display a progress bar, log progress, or perform any other action when the parser makes forward progress.
§Example
use std::sync::Arc;
use readstat::ProgressCallback;
struct LogProgress;
impl ProgressCallback for LogProgress {
fn inc(&self, n: u64) {
println!("Processed {n} more rows");
}
fn parsing_started(&self, path: &str) {
println!("Parsing file: {path}");
}
}Required Methods§
Sourcefn parsing_started(&self, path: &str)
fn parsing_started(&self, path: &str)
Called when parsing begins for the file at path.