pub struct LaunchOptions {
pub engine: EngineType,
pub user_data_dir: Option<PathBuf>,
pub headless: bool,
pub slow_mo: u64,
pub verbose: bool,
pub args: Vec<String>,
pub color_scheme: Option<ColorScheme>,
}Expand description
Options for launching a browser.
Fields§
§engine: EngineTypeThe browser engine to use.
user_data_dir: Option<PathBuf>Path to user data directory.
headless: boolRun in headless mode.
slow_mo: u64Slow down operations by this many milliseconds.
verbose: boolEnable verbose logging.
args: Vec<String>Additional Chrome arguments.
color_scheme: Option<ColorScheme>Color scheme to emulate. None uses the system default.
Implementations§
Source§impl LaunchOptions
impl LaunchOptions
Sourcepub fn chromiumoxide() -> Self
pub fn chromiumoxide() -> Self
Create options for chromiumoxide engine.
Sourcepub fn fantoccini() -> Self
pub fn fantoccini() -> Self
Create options for fantoccini (WebDriver) engine.
Sourcepub fn user_data_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn user_data_dir(self, dir: impl Into<PathBuf>) -> Self
Set the user data directory.
Sourcepub fn color_scheme(self, color_scheme: ColorScheme) -> Self
pub fn color_scheme(self, color_scheme: ColorScheme) -> Self
Set the color scheme for media emulation.
Sourcepub fn all_chrome_args(&self) -> Vec<String>
pub fn all_chrome_args(&self) -> Vec<String>
Get all Chrome arguments (default + custom).
Sourcepub fn get_user_data_dir(&self) -> PathBuf
pub fn get_user_data_dir(&self) -> PathBuf
Get the user data directory, using a default if not specified.
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 · 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
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