pub struct BrowserKindBuilder<P: BrowserProvider> { /* private fields */ }Expand description
Configures a BrowserKind.
Implementations§
Source§impl<P: BrowserProvider> BrowserKindBuilder<P>
impl<P: BrowserProvider> BrowserKindBuilder<P>
Sourcepub fn pool_options(self, options: BrowserPoolOptions<P::LaunchOptions>) -> Self
pub fn pool_options(self, options: BrowserPoolOptions<P::LaunchOptions>) -> Self
Replaces all browser-pool options.
Sourcepub fn launch_options(self, options: P::LaunchOptions) -> Self
pub fn launch_options(self, options: P::LaunchOptions) -> Self
Replaces provider-specific launch options.
Sourcepub fn max_open_pages_per_browser(self, value: usize) -> Self
pub fn max_open_pages_per_browser(self, value: usize) -> Self
Sets the maximum simultaneously open pages in one browser.
Sourcepub fn retire_browser_after_page_count(self, value: u64) -> Self
pub fn retire_browser_after_page_count(self, value: u64) -> Self
Sets the created-page count after which a browser retires.
Sourcepub fn max_browsers(self, value: usize) -> Self
pub fn max_browsers(self, value: usize) -> Self
Sets the maximum number of live or launching browsers.
Sourcepub fn proxy(self, proxy: ProxyConfiguration) -> Self
pub fn proxy(self, proxy: ProxyConfiguration) -> Self
Sets the proxy configuration applied once per browser launch.
Sourcepub fn hooks(self, hooks: BrowserHooks) -> Self
pub fn hooks(self, hooks: BrowserHooks) -> Self
Replaces the browser-pool hooks.
This replaces the default session cookie synchronization hooks too. Add them explicitly
with BrowserHooks::with_session_cookie_sync when custom hooks still need that behavior.
Sourcepub fn session_pool(self, options: SessionPoolOptions) -> Self
pub fn session_pool(self, options: SessionPoolOptions) -> Self
Enables an owned session pool with the supplied options.
Sourcepub fn disable_sessions(self) -> Self
pub fn disable_sessions(self) -> Self
Disables browser sessions and cookie synchronization.
Uses a session pool whose persistence lifecycle is managed by its sharing owner.
Sourcepub fn http_client(self, client: Arc<dyn HttpClient>) -> Self
pub fn http_client(self, client: Arc<dyn HttpClient>) -> Self
Injects the HTTP transport exposed as BrowserContext::send_request.
Sourcepub fn retry_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
pub fn retry_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
Replaces the exact status codes classified as ordinary retries.
Sourcepub fn retry_server_errors(self, enabled: bool) -> Self
pub fn retry_server_errors(self, enabled: bool) -> Self
Controls whether every 5xx response is retried.
Sourcepub fn session_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
pub fn session_status_codes(self, codes: impl IntoIterator<Item = u16>) -> Self
Replaces statuses that mark and rotate a session.
Sets the browser navigation deadline.
Sourcepub fn wait_until(self, wait_until: WaitUntil) -> Self
pub fn wait_until(self, wait_until: WaitUntil) -> Self
Sets the browser lifecycle event awaited after navigation.
Appends a hook that runs after page creation and before navigation.
Appends a hook that runs after navigation and status classification.
Sourcepub fn snapshot_errors_on_failure(self, enabled: bool) -> Self
pub fn snapshot_errors_on_failure(self, enabled: bool) -> Self
Controls whether handler failures persist page HTML and a PNG screenshot.
Sourcepub fn build(self) -> Result<BrowserKind<P>, HttpClientError>
pub fn build(self) -> Result<BrowserKind<P>, HttpClientError>
Builds the kind, constructing a typed-error HTTP client when none was injected.