use std::marker::PhantomData;
use crate::services::whois::WhoisResponses;
use super::*;
#[derive(Debug)]
pub struct WhoisStats<'a> {
pub responses: usize,
pub geo_locations: usize,
pub network_infos: usize,
pub whois: usize,
pub errors: usize,
phantom: PhantomData<&'a usize>,
}
impl<'a> Statistics<'a> for WhoisResponses {
type StatsOut = WhoisStats<'a>;
fn statistics(&'a self) -> Self::StatsOut {
WhoisStats {
responses: self.iter().count(),
geo_locations: self.geo_location().count(),
network_infos: self.network_info().count(),
whois: self.whois().count(),
errors: self.err().count(),
phantom: PhantomData,
}
}
}