Skip to main content

PageRunner

Trait PageRunner 

Source
pub trait PageRunner: Send + Sync {
    // Required method
    fn run<'a>(
        &'a self,
        kind: &'static str,
        url: &'a str,
        opts: &'a ScrapeOptions,
        mode: RobotsMode,
    ) -> BoxFuture<'a, Result<Document, ApiError>>;

    // Provided method
    fn capacity(&self) -> Option<usize> { ... }
}
Expand description

爬取里逐页抓取的执行者。网关把它装到 Scraper 上(engine::Scraper::route_pages), 爬取前沿留在网关,页面交给工人。

Required Methods§

Source

fn run<'a>( &'a self, kind: &'static str, url: &'a str, opts: &'a ScrapeOptions, mode: RobotsMode, ) -> BoxFuture<'a, Result<Document, ApiError>>

Provided Methods§

Source

fn capacity(&self) -> Option<usize>

执行方的准入容量(网关:在线工人报告的准入值之和);None 时用本机的准入。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§