Launcher

Struct Launcher 

Source
pub struct Launcher<'a, 'b, 'c> { /* private fields */ }
Expand description

Implementations§

Source§

impl<'a, 'b, 'c> Launcher<'a, 'b, 'c>

Source

pub async fn launch(self) -> Result<Browser, Arc<Error>>

Source

pub fn executable(self, x: &'a Path) -> Self

Path to a browser executable to run instead of the bundled one. If executablePath is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.

Source

pub fn args(self, x: &'b [String]) -> Self

Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.

Source

pub fn ignore_all_default_args(self, x: bool) -> Self

If true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option; use with care. Defaults to false.

Source

pub fn handle_sigint(self, x: bool) -> Self

Close the browser process on Ctrl-C. Defaults to true.

Source

pub fn handle_sigterm(self, x: bool) -> Self

Close the browser process on SIGTERM. Defaults to true.

Source

pub fn handle_sighup(self, x: bool) -> Self

Close the browser process on SIGHUP. Defaults to true.

Source

pub fn timeout(self, x: f64) -> Self

Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.

Source

pub fn devtools(self, x: bool) -> Self

Chromium-only Whether to auto-open a Developer Tools panel for each tab. If this option is true, the headless option will be set false.

Source

pub fn proxy(self, x: ProxySettings) -> Self

Network proxy settings.

Source

pub fn downloads(self, x: &'c Path) -> Self

If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.

Source

pub fn slowmo(self, x: f64) -> Self

Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.

Source

pub fn env(self, x: Map<String, Value>) -> Self

Specify environment variables that will be visible to the browser. Defaults to process.env.

Source

pub fn headless(self, x: bool) -> Self

Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to true unless the devtools option is true.

Source

pub fn chromium_sandbox(self, x: bool) -> Self

Enable Chromium sandboxing. Defaults to false.

Source

pub fn firefox_user_prefs(self, x: Map<String, Value>) -> Self

Firefox user preferences. Learn more about the Firefox user preferences at about:config.

Source

pub fn channel(self, x: BrowserChannel) -> Self

Source

pub fn clear_executable(self) -> Self

Source

pub fn clear_args(self) -> Self

Source

pub fn clear_ignore_all_default_args(self) -> Self

Source

pub fn clear_handle_sigint(self) -> Self

Source

pub fn clear_handle_sigterm(self) -> Self

Source

pub fn clear_handle_sighup(self) -> Self

Source

pub fn clear_timeout(self) -> Self

Source

pub fn clear_devtools(self) -> Self

Source

pub fn clear_proxy(self) -> Self

Source

pub fn clear_downloads(self) -> Self

Source

pub fn clear_slowmo(self) -> Self

Source

pub fn clear_env(self) -> Self

Source

pub fn clear_headless(self) -> Self

Source

pub fn clear_chromium_sandbox(self) -> Self

Source

pub fn clear_firefox_user_prefs(self) -> Self

Source

pub fn clear_channel(self) -> Self

Auto Trait Implementations§

§

impl<'a, 'b, 'c> Freeze for Launcher<'a, 'b, 'c>

§

impl<'a, 'b, 'c> RefUnwindSafe for Launcher<'a, 'b, 'c>

§

impl<'a, 'b, 'c> Send for Launcher<'a, 'b, 'c>

§

impl<'a, 'b, 'c> Sync for Launcher<'a, 'b, 'c>

§

impl<'a, 'b, 'c> Unpin for Launcher<'a, 'b, 'c>

§

impl<'a, 'b, 'c> UnwindSafe for Launcher<'a, 'b, 'c>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.