powd/src/print.rs

21 lines
588 B
Rust

use crate::Log;
#[derive(clap::Args, Debug, Clone)]
#[command(author, version, about, long_about = None)]
pub struct PrintRes {
#[arg(long)]
pub db: std::path::PathBuf,
}
impl PrintRes {
pub fn run(&self) {
let db = sled::open(&self.db).unwrap();
for entry in db.iter() {
let (difficulty, entry) = entry.unwrap();
let log: Log = bincode::deserialize::<Log>(&entry[..]).unwrap();
let difficulty: u32 = bincode::deserialize::<u32>(&difficulty).unwrap();
println!("{difficulty}: {}", log.time);
}
}
}