#[non_exhaustive]pub struct LaunchOptions {Show 13 fields
pub headless: Option<bool>,
pub executable_path: Option<String>,
pub channel: Option<String>,
pub args: Option<Vec<String>>,
pub env: Option<HashMap<String, String>>,
pub proxy: Option<ProxySettings>,
pub slow_mo: Option<f64>,
pub timeout: Option<f64>,
pub downloads_path: Option<String>,
pub traces_dir: Option<String>,
pub devtools: Option<bool>,
pub chromium_sandbox: Option<bool>,
pub user_data_dir: Option<PathBuf>,
}Expand description
Browser launch options. See: https://playwright.dev/docs/api/class-browsertype#browser-type-launch
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.headless: Option<bool>§executable_path: Option<String>§channel: Option<String>§args: Option<Vec<String>>§env: Option<HashMap<String, String>>§proxy: Option<ProxySettings>§slow_mo: Option<f64>§timeout: Option<f64>§downloads_path: Option<String>§traces_dir: Option<String>§devtools: Option<bool>§chromium_sandbox: Option<bool>§user_data_dir: Option<PathBuf>Optional persistent user-data-dir. When set, the browser is launched
against this directory instead of a throwaway temp dir, so cookies,
localStorage, etc. persist across runs (Playwright userDataDir).
Implementations§
Source§impl LaunchOptions
impl LaunchOptions
pub fn new() -> Self
pub fn headless(self, v: bool) -> Self
pub fn executable_path(self, v: impl Into<String>) -> Self
pub fn channel(self, v: impl Into<String>) -> Self
pub fn args(self, v: Vec<String>) -> Self
pub fn proxy(self, v: ProxySettings) -> Self
pub fn timeout_ms(self, v: f64) -> Self
pub fn devtools(self, v: bool) -> Self
Sourcepub fn user_data_dir(self, v: impl Into<PathBuf>) -> Self
pub fn user_data_dir(self, v: impl Into<PathBuf>) -> Self
Set a persistent user-data-dir (Playwright userDataDir).
Sourcepub fn timeout_ms_or_default(&self) -> f64
pub fn timeout_ms_or_default(&self) -> f64
Resolved action/launch timeout in milliseconds.
Trait Implementations§
Source§impl Clone for LaunchOptions
impl Clone for LaunchOptions
Source§fn clone(&self) -> LaunchOptions
fn clone(&self) -> LaunchOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LaunchOptions
impl Debug for LaunchOptions
Source§impl Default for LaunchOptions
impl Default for LaunchOptions
Source§fn default() -> LaunchOptions
fn default() -> LaunchOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LaunchOptions
impl RefUnwindSafe for LaunchOptions
impl Send for LaunchOptions
impl Sync for LaunchOptions
impl Unpin for LaunchOptions
impl UnsafeUnpin for LaunchOptions
impl UnwindSafe for LaunchOptions
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