pub struct BrowserProcess { /* private fields */ }Expand description
The result of launching a browser: the owning process handle plus the browser-level WebSocket endpoint to connect to.
Implementations§
Source§impl BrowserProcess
impl BrowserProcess
Sourcepub async fn launch(opts: &LaunchOptions) -> Result<Self>
pub async fn launch(opts: &LaunchOptions) -> Result<Self>
Spawn a Chromium-based browser per opts and discover its DevTools
WebSocket endpoint. Blocks until the browser is ready (or timeout).
Sourcepub fn ws_url(&self) -> &str
pub fn ws_url(&self) -> &str
The browser-level WebSocket endpoint (ws://host:port/devtools/browser/<id>).
Sourcepub async fn kill(&mut self) -> Result<()>
pub async fn kill(&mut self) -> Result<()>
Close the browser. We give it up to GRACE to exit gracefully (we send
Browser.close over CDP beforehand, which lets Chrome tear down its
child processes and release profile locks cleanly); if it hasn’t exited
by then we SIGKILL it and clear any stale singleton lock ourselves.
Sourcepub fn stderr_tail(&self) -> String
pub fn stderr_tail(&self) -> String
Recent stderr output (for diagnostics).
Trait Implementations§
Source§impl Drop for BrowserProcess
impl Drop for BrowserProcess
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserProcess
impl !UnwindSafe for BrowserProcess
impl Freeze for BrowserProcess
impl Send for BrowserProcess
impl Sync for BrowserProcess
impl Unpin for BrowserProcess
impl UnsafeUnpin for BrowserProcess
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