pub struct BrowserConfig {
pub headless: bool,
pub timeout: Duration,
pub viewport: (u32, u32),
pub args: Vec<String>,
}Expand description
Configuration options for launching a Chrome/Chromium instance.
Use BrowserConfig::default() to get sensible defaults, then
customise the fields you need.
§Example
use ferrous_browser::{Browser, BrowserConfig};
use std::time::Duration;
let config = BrowserConfig {
headless: true,
timeout: Duration::from_secs(60),
viewport: (1920, 1080),
args: vec!["--disable-extensions".to_string()],
};
let browser = Browser::launch_chrome(Some(config)).await?;Fields§
§headless: boolRun Chrome in headless mode (default: true).
timeout: DurationMaximum time to wait for Chrome to start (default: 30 s).
viewport: (u32, u32)Viewport size as (width, height) in logical pixels (default: 1280 x 720).
args: Vec<String>Additional Chrome command-line arguments appended after the built-in flags.
Trait Implementations§
Source§impl Clone for BrowserConfig
impl Clone for BrowserConfig
Source§fn clone(&self) -> BrowserConfig
fn clone(&self) -> BrowserConfig
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 BrowserConfig
impl Debug for BrowserConfig
Auto Trait Implementations§
impl Freeze for BrowserConfig
impl RefUnwindSafe for BrowserConfig
impl Send for BrowserConfig
impl Sync for BrowserConfig
impl Unpin for BrowserConfig
impl UnsafeUnpin for BrowserConfig
impl UnwindSafe for BrowserConfig
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
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>
Converts
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>
Converts
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