pub struct BrowserPool<P: BrowserProvider> { /* private fields */ }Expand description
A lazily launched pool of provider browsers and their pages.
Implementations§
Source§impl<P: BrowserProvider> BrowserPool<P>
impl<P: BrowserProvider> BrowserPool<P>
Sourcepub fn new(provider: P, options: BrowserPoolOptions<P::LaunchOptions>) -> Self
pub fn new(provider: P, options: BrowserPoolOptions<P::LaunchOptions>) -> Self
Creates an empty pool without requiring a Tokio runtime.
Browser launch and the fallback close worker are both lazy: the first call to
Self::new_page starts them from within the caller’s runtime. This intentionally differs
from the asynchronous constructor sketched in INTERFACE §12.
Sourcepub async fn new_page(
&self,
opts: PageOptions,
) -> Result<PageHandle, BrowserError>
pub async fn new_page( &self, opts: PageOptions, ) -> Result<PageHandle, BrowserError>
Acquires a page, launching or waiting for browser capacity as needed.
Sourcepub async fn shutdown(&self) -> Result<(), BrowserError>
pub async fn shutdown(&self) -> Result<(), BrowserError>
Closes all pages and browsers and rejects future acquisitions.
Calling shutdown more than once is safe.
Trait Implementations§
Source§impl<P: BrowserProvider> Clone for BrowserPool<P>
impl<P: BrowserProvider> Clone for BrowserPool<P>
Auto Trait Implementations§
impl<P> !RefUnwindSafe for BrowserPool<P>
impl<P> !UnwindSafe for BrowserPool<P>
impl<P> Freeze for BrowserPool<P>
impl<P> Send for BrowserPool<P>
impl<P> Sync for BrowserPool<P>
impl<P> Unpin for BrowserPool<P>
impl<P> UnsafeUnpin for BrowserPool<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more