use async_trait::async_trait;

pub type Error = Box<dyn std::error::Error + Send + Sync + 'static>;

#[async_trait]
pub trait Page: Send + Sync {
    async fn process_request(
        &self,
    ) -> Result<(Vec<Box<dyn Page>>, Vec<Box<dyn PageResult>>), Error>;

    fn get_url<'a>(&'a self) -> &'a String;
}

#[async_trait]
pub trait PageResult: Send + Sync {
    async fn save_results(&self) -> Result<(), Error>;
}
