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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more