pub struct ConnectOptions {
pub engine: EngineType,
pub cdp_endpoint: Option<String>,
pub ws_endpoint: Option<String>,
pub slow_mo: u64,
pub timeout: Option<Duration>,
pub protocol_timeout: Option<Duration>,
pub seed_cookies: Vec<Value>,
pub verbose: bool,
pub node_executable: Option<PathBuf>,
pub node_working_dir: Option<PathBuf>,
}Expand description
Options for attaching to a running browser over CDP.
Fields§
§engine: EngineTypeBrowser automation engine used for the connection.
cdp_endpoint: Option<String>HTTP DevTools endpoint, for example http://127.0.0.1:9222.
ws_endpoint: Option<String>DevTools browser WebSocket endpoint.
slow_mo: u64Slow down Playwright/Puppeteer operations by this many milliseconds.
timeout: Option<Duration>Optional connection timeout.
protocol_timeout: Option<Duration>Optional Puppeteer timeout for individual CDP calls.
Cookies to seed after attaching, in CDP/Playwright cookie format.
verbose: boolEnable verbose bridge logging.
node_executable: Option<PathBuf>Node.js executable for Playwright/Puppeteer bridge engines.
node_working_dir: Option<PathBuf>Directory where Node resolves the Playwright/Puppeteer package.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn chromiumoxide() -> Self
pub fn chromiumoxide() -> Self
Create Chromiumoxide connection options.
Sourcepub fn playwright() -> Self
pub fn playwright() -> Self
Create Playwright bridge connection options.
Sourcepub fn cdp_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn cdp_endpoint(self, endpoint: impl Into<String>) -> Self
Select an HTTP DevTools endpoint.
Sourcepub fn ws_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn ws_endpoint(self, endpoint: impl Into<String>) -> Self
Select a DevTools browser WebSocket endpoint.
Sourcepub fn protocol_timeout(self, timeout: Duration) -> Self
pub fn protocol_timeout(self, timeout: Duration) -> Self
Set Puppeteer’s timeout for individual CDP calls.
Seed cookies immediately after the connection is established.
Sourcepub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
pub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
Override the Node.js executable for bridge engines.
Sourcepub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
pub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
Set the directory where Node resolves Playwright or Puppeteer.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnsafeUnpin for ConnectOptions
impl UnwindSafe for ConnectOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more