use crate::error::EntryError; use std::fmt; #[derive(Debug)] pub struct PullStatus { count: usize, errors: Vec, } impl PullStatus { pub fn new(count: usize, errors: Vec) -> Self { Self { count, errors } } } impl fmt::Display for PullStatus { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "pulled {} entries with {} errors", self.count, self.errors.len() ) } } #[derive(Debug)] pub struct StoreStatus { count: usize, } impl StoreStatus { pub fn new(count: usize) -> Self { Self { count } } } impl fmt::Display for StoreStatus { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "stored {} feeds", self.count,) } }