pub struct FetchContext {
pub http: Arc<HttpClient>,
pub rate_limiter: Arc<RateLimiter>,
pub log: Arc<ProvenanceLog>,
pub session_id: String,
pub cache_root: Option<Utf8PathBuf>,
}Expand description
Per-fetch context shared by all Source impls.
Held by the orchestrator (CLI / MCP server) and passed by reference into
each Source::fetch. Sources MUST NOT construct their own
HttpClient / RateLimiter / ProvenanceLog — they go through
this context for uniform politeness, redirect allowlisting, and audit
logging.
Fields§
§http: Arc<HttpClient>Shared, allowlist-aware HTTP client. See HttpClient.
rate_limiter: Arc<RateLimiter>Process-wide async rate limiter. See RateLimiter.
log: Arc<ProvenanceLog>Append-only, hash-chained provenance log. Source impls MUST emit
one LogEvent::Fetch row per attempt via log.append. See
ProvenanceLog.
session_id: String26-char ULID identifying this process invocation. Mirrors the
session_id stamped into every provenance row by the writer; held
here so source impls can include it in their own structured logs
without re-reading the env.
cache_root: Option<Utf8PathBuf>Resolver cache root (<cache_root>/resolver/<safekey>.toml, see
docs/CACHE.md and crate::resolver_cache). Some enables the
metadata-only resolve cache (repeat resolves served from disk,
avoiding upstream rate limits); None disables it (tests, or a
caller that opts out). Only metadata_only consults it — per-PDF
fetches are never cached.
Trait Implementations§
Source§impl Clone for FetchContext
impl Clone for FetchContext
Source§fn clone(&self) -> FetchContext
fn clone(&self) -> FetchContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more