pub enum SpiderOutput {
Item(Value),
FollowRequest(Request),
}Expand description
The result of processing a response: either a scraped data item or a follow-up request to enqueue.
Your Spider::parse implementation (or a
per-request Callback) returns a Vec<SpiderOutput>. The crawler engine
collects Item values into the final ItemList
and feeds FollowRequest values back into the Scheduler.
Variants§
Item(Value)
A scraped data item to be collected. The JSON value is passed through the
spider’s on_scraped_item hook before being stored, which gives you a
chance to validate, transform, or drop it.
FollowRequest(Request)
A new request to enqueue for crawling. The engine checks domain restrictions and deduplication before actually scheduling it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpiderOutput
impl !RefUnwindSafe for SpiderOutput
impl Send for SpiderOutput
impl Sync for SpiderOutput
impl Unpin for SpiderOutput
impl UnsafeUnpin for SpiderOutput
impl !UnwindSafe for SpiderOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more