pub struct ParseOutput<I> { /* private fields */ }Expand description
Async output sink passed into a spider’s parse method.
Implementations§
Source§impl<I: 'static> ParseOutput<I>
impl<I: 'static> ParseOutput<I>
Sourcepub async fn add_item(&self, item: I) -> Result<(), SpiderError>
pub async fn add_item(&self, item: I) -> Result<(), SpiderError>
Emits a scraped item into the runtime.
Use this when the current page produced one structured result that should continue through the configured pipeline chain. This call is async so the runtime can apply backpressure when downstream work is saturated.
Sourcepub async fn add_request(&self, request: Request) -> Result<(), SpiderError>
pub async fn add_request(&self, request: Request) -> Result<(), SpiderError>
Emits a new request to be crawled.
Requests emitted here are forwarded into the scheduler path.
Sourcepub async fn add_items(
&self,
items: impl IntoIterator<Item = I>,
) -> Result<(), SpiderError>
pub async fn add_items( &self, items: impl IntoIterator<Item = I>, ) -> Result<(), SpiderError>
Emits multiple scraped items into the runtime.
Sourcepub async fn add_requests(
&self,
requests: impl IntoIterator<Item = Request>,
) -> Result<(), SpiderError>
pub async fn add_requests( &self, requests: impl IntoIterator<Item = Request>, ) -> Result<(), SpiderError>
Emits multiple new requests to be crawled.
Trait Implementations§
Source§impl<I> Clone for ParseOutput<I>
impl<I> Clone for ParseOutput<I>
Auto Trait Implementations§
impl<I> Freeze for ParseOutput<I>
impl<I> !RefUnwindSafe for ParseOutput<I>
impl<I> Send for ParseOutput<I>
impl<I> Sync for ParseOutput<I>
impl<I> Unpin for ParseOutput<I>
impl<I> !UnwindSafe for ParseOutput<I>
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