Web Search (Rust)
Rust implementation of the web-search library, CLI, and HTTP service. It
mirrors the JavaScript package in ../js with the same 22-provider catalog,
provider categories, merge strategies, and discovery surface.
Install
As a library:
[]
= "0.2"
From a local checkout before a crates.io release is visible:
[]
= { = "../web-search/rust" }
For deterministic result merging without providers, the CLI/server, or their network and browser dependencies:
[]
= { = "0.4", = false }
This merge-only configuration excludes Axum, Reqwest, Tokio, web-capture,
and the native-TLS/OpenSSL dependency graph. SearchResult, MergeOptions,
MergeStrategy, and the functions in web_search::merger remain available.
Library
use ;
async
Caller-owned transport and detailed outcomes
Implement SearchTransport for a cache or HTTP stack, then pass it to the
detailed API. Each ProviderOutcome retains an independent status/error and
the exact TransportResponse bytes (plus an optional opaque cache receipt).
use Arc;
use ;
let transport: = new;
let detailed = engine
.search_detailed_with_options
.await;
Provider work is polled within the returned aggregate future instead of being
detached with tokio::spawn; dropping that future therefore drops all in-flight
requests. Single-provider callers can use search_single_with_transport, and
provider implementations expose SearchProvider::search_with_transport.
CLI
HTTP Service
Providers
The live registry has 22 providers in four categories:
| Category | Provider ids |
|---|---|
search |
google, bing, duckduckgo, searx, brave, mojeek, ecosia, startpage, yahoo, lite, wc:* |
knowledge |
wikipedia, wikidata |
papers |
crossref, openalex, arxiv |
code |
github, hackernews |
google and bing use official APIs when credentials are configured and fall
back to HTML parsing otherwise. GITHUB_TOKEN is optional and raises the GitHub
search rate limit.
web-capture
wc:wikipedia, wc:duckduckgo, wc:google, wc:bing, and wc:brave delegate
to the published web-capture crate. Runtime errors from that component are
retained as provider errors by detailed aggregate searches, so other selected
providers can still return results without erasing the diagnostic.
use ;
let provider = new;
let results = provider.search.await?;
Release
The Rust workflow publishes web-search to crates.io from main after lint,
tests, doc tests, and package checks pass. GitHub releases are tagged as
rust-v<version> so they stay distinct from JavaScript js-v<version> releases.
The current web-capture 0.3.31 dependency requires Rust 1.96 or newer, which
is declared as this crate's MSRV in Cargo.toml.
Development
Cross-language parity is checked from the repository root:
License
Unlicense - Public Domain