Docs/API reference

Rust API and rustdoc

The complete generated module/type/trait reference, plus a map of the entry points used to build datasets.

Download .md
Developers3 min read4 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Open the exact reference for your source

rustdoc reads the Rust declarations directly and includes functions, public fields, enum variants, trait implementations, generics and source links. Its search is the authority for the full Rust surface; the Node and Python indexes document their separate wrappers.

Build with the browser feature to include optional Chromium modules. CLI and PyO3 FFI symbols are feature-specific; add cli or python only when you need those surfaces and have their build dependencies. These commands build documentation; they do not run examples as tests.

cargo doc --locked --no-deps --lib --features browser --open
# Output: target/doc/crawlingo/index.html
# All feature-gated declarations, including the binding layer:
cargo doc --locked --no-deps --all-features --open
shell4 lines · copy-ready

Public module map

ModulePurposeStart with
datasetBulk jobs, small builders, validation and exportsDatasetJob, JobConfig, JobField, JobReport; builder::Dataset; stream::DatasetStream
engine::sessionShared request state and pooled transportsSession::new, from_config, fetch_manager, clone_session
engine::fetcherRequests, responses and injectable transportsFetchRequest, NormalizedResponse, FetchManager, Transport, MockTransport
engine::retry / rate_limiter / poolBackoff, pacing and connection limitsRetryPolicy, HostRateLimiter, ConnectionPoolConfig
engine::auth / cache / middlewareAuthentication, response caching and layersAuthScheme, InMemoryCache, MiddlewareStack, Layer
engine::downloadFile and in-memory body downloadsDownloader, DownloadResult
engine::browserOptional local Chromium/CDP renderingEnable the browser Cargo feature
crawlDiscovery, pagination, robots and frontier storagecrawler::Crawler; sitemap; pagination; frontier; robots
parserHTML parsing, DOM structure and Pagestreaming::HtmlParser; document::Page, DomTree
selectorCSS, basic XPath, regex and text selectioncss, xpath, regex_selector, text_anchor
extractionField normalization and attribute extractionExtractionEngine, ExtractionType
fingerprint / matcherStored element identity and heuristic recoveryFingerprintStore and auto_matcher
change / watchValue comparison and pollingChangeEvent, ChangeType; watch::monitor::Watch
configTOML/JSON configuration and environment overridesCrawlingoConfig, RetryConfigSpec, PoolConfigSpec
metricsFetch counts and timingsMetrics, MetricsSnapshot, MetricsLayer
error / utilTyped failures and URL/header/value utilitiesCrawlingoError, Result; util::url

Asynchronous job example

Use async APIs inside an existing Tokio runtime. The shared TOKIO_RUNTIME exists for blocking callers and bindings; avoid nesting its block_on inside another async runtime.

Keep the Arc<Session> alive for related work. Cancellation is cooperative. Do not release a job directory to another writer before the active job has stopped.

use crawlingo::dataset::{DatasetJob, JobConfig};
use crawlingo::engine::session::Session;
use std::sync::Arc;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config: JobConfig = serde_json::from_reader(
        std::fs::File::open("job.json")?
    )?;
    let session = Arc::new(Session::new());
    *session.rate_limit_rps.write().unwrap() = 2.0;
    let job = DatasetJob::new(config, session)?;
    let report = job.run().await?;
    println!("written={}, failed={}", report.records_written, report.pages_failed);
    Ok(())
}
rust16 lines · copy-ready

Versioned documentation artifacts

The engine Rust API documentation workflow builds browser-enabled rustdoc with broken intra-doc links treated as errors. It uploads the rust-docs artifact. The SDK release requires that artifact and includes crawlingo-VERSION-rustdoc.tar.gz in its checksummed release manifest.

Download a successful workflow artifact or a published release archive, extract it, and open doc/crawlingo/index.html. Prepared workflow code is not proof of a successful hosted build or upload. Unpublished versions do not have a registry docs.rs page yet.