Skip to main content

Callback

Type Alias Callback 

Source
pub type Callback = Box<dyn Fn(Response) -> Vec<SpiderOutput> + Send + Sync>;
Expand description

A boxed closure that processes an HTTP response and returns spider outputs.

Callbacks are attached to individual Requests via Request::with_callback. When the crawler receives a response for that request, it invokes the callback instead of the spider’s default parse method. This lets you route different pages to different parsing logic.

Aliased Type§

pub struct Callback(/* private fields */);