#[non_exhaustive]pub struct BrowserPoolOptions<L> {
pub max_open_pages_per_browser: usize,
pub retire_browser_after_page_count: u64,
pub max_browsers: Option<usize>,
pub page_acquire_timeout: Duration,
pub launch_options: L,
pub proxy: Option<ProxyConfiguration>,
pub hooks: BrowserHooks,
}Expand description
Configuration for a BrowserPool.
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.max_open_pages_per_browser: usizeMaximum number of simultaneously open pages in one browser.
retire_browser_after_page_count: u64Number of created pages after which a browser is retired.
max_browsers: Option<usize>Maximum number of live or launching browsers, or None for no limit.
page_acquire_timeout: DurationMaximum time to wait for a page, including browser launch and hook work.
launch_options: LProvider-specific options cloned for every browser launch.
proxy: Option<ProxyConfiguration>Optional proxy configuration resolved once per browser launch.
hooks: BrowserHooksBrowser lifecycle hooks.
Implementations§
Source§impl<L: Default> BrowserPoolOptions<L>
impl<L: Default> BrowserPoolOptions<L>
Source§impl<L> BrowserPoolOptions<L>
impl<L> BrowserPoolOptions<L>
Sourcepub fn with_max_open_pages_per_browser(self, value: usize) -> Self
pub fn with_max_open_pages_per_browser(self, value: usize) -> Self
Sets the maximum number of simultaneously open pages in one browser.
Sourcepub fn with_retire_browser_after_page_count(self, value: u64) -> Self
pub fn with_retire_browser_after_page_count(self, value: u64) -> Self
Sets the page count after which a browser is retired.
Sourcepub fn with_max_browsers(self, value: Option<usize>) -> Self
pub fn with_max_browsers(self, value: Option<usize>) -> Self
Sets the maximum number of live or launching browsers.
Sourcepub fn with_page_acquire_timeout(self, value: Duration) -> Self
pub fn with_page_acquire_timeout(self, value: Duration) -> Self
Sets the maximum duration allowed for page acquisition.
Sourcepub fn with_launch_options(self, value: L) -> Self
pub fn with_launch_options(self, value: L) -> Self
Replaces the provider-specific browser launch options.
Sourcepub fn with_proxy(self, value: Option<ProxyConfiguration>) -> Self
pub fn with_proxy(self, value: Option<ProxyConfiguration>) -> Self
Sets the proxy configuration used for browser launches.
Sourcepub fn with_hooks(self, value: BrowserHooks) -> Self
pub fn with_hooks(self, value: BrowserHooks) -> Self
Replaces the browser lifecycle hooks.