use crate::model::robots_txt::RobotsTxt;
use std::time::SystemTime;
#[derive(Debug, Clone)]
pub(crate) enum FetchedRobotsTxtContainer {
FetchDenied,
FetchFailed,
Fetched(RobotsTxt),
}
#[derive(Debug, Clone)]
pub struct FetchedRobotsTxt {
fetched_at: SystemTime,
container: FetchedRobotsTxtContainer,
}
impl FetchedRobotsTxt {
pub(crate) fn new(container: FetchedRobotsTxtContainer) -> FetchedRobotsTxt {
FetchedRobotsTxt {
fetched_at: SystemTime::now(),
container,
}
}
pub(crate) fn get_container(&self) -> &FetchedRobotsTxtContainer {
&self.container
}
pub fn get_fetched_at(&self) -> &SystemTime {
&self.fetched_at
}
}