Skip to main content

BrowserPoolOptions

Struct BrowserPoolOptions 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§max_open_pages_per_browser: usize

Maximum number of simultaneously open pages in one browser.

§retire_browser_after_page_count: u64

Number 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: Duration

Maximum time to wait for a page, including browser launch and hook work.

§launch_options: L

Provider-specific options cloned for every browser launch.

§proxy: Option<ProxyConfiguration>

Optional proxy configuration resolved once per browser launch.

§hooks: BrowserHooks

Browser lifecycle hooks.

Implementations§

Source§

impl<L: Default> BrowserPoolOptions<L>

Source

pub fn new() -> Self

Creates options with the standard pool limits and default provider launch options.

Source§

impl<L> BrowserPoolOptions<L>

Source

pub fn with_max_open_pages_per_browser(self, value: usize) -> Self

Sets the maximum number of simultaneously open pages in one browser.

Source

pub fn with_retire_browser_after_page_count(self, value: u64) -> Self

Sets the page count after which a browser is retired.

Source

pub fn with_max_browsers(self, value: Option<usize>) -> Self

Sets the maximum number of live or launching browsers.

Source

pub fn with_page_acquire_timeout(self, value: Duration) -> Self

Sets the maximum duration allowed for page acquisition.

Source

pub fn with_launch_options(self, value: L) -> Self

Replaces the provider-specific browser launch options.

Source

pub fn with_proxy(self, value: Option<ProxyConfiguration>) -> Self

Sets the proxy configuration used for browser launches.

Source

pub fn with_hooks(self, value: BrowserHooks) -> Self

Replaces the browser lifecycle hooks.

Trait Implementations§

Source§

impl<L> Debug for BrowserPoolOptions<L>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L: Default> Default for BrowserPoolOptions<L>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<L> !Freeze for BrowserPoolOptions<L>

§

impl<L> !RefUnwindSafe for BrowserPoolOptions<L>

§

impl<L> !UnwindSafe for BrowserPoolOptions<L>

§

impl<L> Send for BrowserPoolOptions<L>
where L: Send,

§

impl<L> Sync for BrowserPoolOptions<L>
where L: Sync,

§

impl<L> Unpin for BrowserPoolOptions<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for BrowserPoolOptions<L>
where L: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more