Module item

Module item 

Source
Expand description

Item traits and parse-time output helpers.

ParseOutput is the async sink carried by a spider’s parse context. Spiders typically use it indirectly through ParseContext helpers such as cx.add_item(...) and cx.add_request(...), while the runtime uses it to stream scraped items and follow-up requests as they are discovered.

§Example

use spider_util::item::{ScrapedItem, ParseOutput};

#[spider_macro::scraped_item]
struct Article {
    title: String,
    content: String,
}

// In your spider's parse method:
// output.add_item(Article { title: "...", content: "..." }).await?;
// output.add_request(request).await?;

ParseOutput intentionally hides the runtime transport details. The crawler can backpressure parsing internally while spider code continues to use familiar add_* methods.

Structs§

ItemFieldSchema
Static schema metadata for a single item field.
ItemSchema
Static schema metadata for a scraped item type.
ParseOutput
Async output sink passed into a spider’s parse method.

Enums§

FieldValueType
Stable field kinds used by typed item schema metadata.

Traits§

ScrapedItem
Trait implemented by item types emitted from spiders.
TypedItemSchema
Trait for typed item definitions that can expose static schema metadata.