#[non_exhaustive]pub struct BrowserContext {
pub request: Arc<Request>,
pub page: PageHandle,
pub response: Option<BrowserResponse>,
pub session: Option<Arc<Session>>,
pub proxy_info: Option<ProxyInfo>,
pub enqueue: EnqueueLinker,
pub storage: StorageHandle,
pub send_request: Arc<dyn HttpClient>,
pub crawler: CrawlerHandle,
}Expand description
Per-request context produced by BrowserKind.
This matches the browser context in INTERFACE §4.2 except that the proposed log: Log field
is omitted because no Log type exists; use tracing macros in the meantime.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request: Arc<Request>Crawl request that produced this context.
page: PageHandleLive browser page.
Cloning the context shares the same underlying page. Every clone uses the page handle’s common at-most-once close state, so cleanup cannot close the provider page twice.
response: Option<BrowserResponse>Navigation response metadata, when exposed by the provider.
session: Option<Arc<Session>>Session used for this attempt, if sessions are enabled.
proxy_info: Option<ProxyInfo>Proxy owned by the browser containing this page.
Browser proxies are applied at browser launch, not per navigation. Consequently this is the owning browser’s proxy and per-request proxy rotation is not possible for browser kinds.
enqueue: EnqueueLinkerDOM-aware URL enqueue helper linked to the running crawler.
storage: StorageHandleOpen default storage resources.
send_request: Arc<dyn HttpClient>HTTP client for out-of-band requests made during browser flows.
crawler: CrawlerHandleWeak handle back to the running crawler.
Trait Implementations§
Source§impl Clone for BrowserContext
impl Clone for BrowserContext
Source§fn clone(&self) -> BrowserContext
fn clone(&self) -> BrowserContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more