Trait Scrapable

Source
pub trait Scrapable {
    type Config: Clone + Send + 'static;

    // Required methods
    fn new(config: &Self::Config) -> Result<Self>
       where Self: Sized;
    fn seed(&self) -> Seed;
    fn accept(&self, url: &str, crawling_ctx: CrawlingContext) -> bool;
    fn scrap(
        &mut self,
        page: String,
        scraping_ctx: ScrapingContext,
    ) -> Result<()>;

    // Provided method
    fn finalizer(&mut self) { ... }
}

Required Associated Types§

Source

type Config: Clone + Send + 'static

Required Methods§

Source

fn new(config: &Self::Config) -> Result<Self>
where Self: Sized,

Source

fn seed(&self) -> Seed

Source

fn accept(&self, url: &str, crawling_ctx: CrawlingContext) -> bool

Source

fn scrap(&mut self, page: String, scraping_ctx: ScrapingContext) -> Result<()>

Provided Methods§

Source

fn finalizer(&mut self)

Implementors§