pub struct BrowserConfig {
pub webdriver_url: String,
pub browser: BrowserType,
pub headless: bool,
pub viewport_width: u32,
pub viewport_height: u32,
pub page_load_timeout_secs: u64,
pub script_timeout_secs: u64,
pub implicit_wait_secs: u64,
pub user_agent: Option<String>,
pub browser_args: Vec<String>,
}Expand description
Configuration for browser sessions.
Fields§
§webdriver_url: StringWebDriver server URL (e.g., “http://localhost:4444”)
browser: BrowserTypeBrowser type to use
headless: boolRun in headless mode (no visible window)
viewport_width: u32Viewport width in pixels
viewport_height: u32Viewport height in pixels
page_load_timeout_secs: u64Page load timeout in seconds
script_timeout_secs: u64Script execution timeout in seconds
implicit_wait_secs: u64Implicit wait timeout in seconds
user_agent: Option<String>User agent string override
browser_args: Vec<String>Additional browser arguments
Implementations§
Source§impl BrowserConfig
impl BrowserConfig
Sourcepub fn webdriver_url(self, url: impl Into<String>) -> Self
pub fn webdriver_url(self, url: impl Into<String>) -> Self
Set the WebDriver URL.
Sourcepub fn browser(self, browser: BrowserType) -> Self
pub fn browser(self, browser: BrowserType) -> Self
Set the browser type.
Sourcepub fn page_load_timeout(self, secs: u64) -> Self
pub fn page_load_timeout(self, secs: u64) -> Self
Set page load timeout.
Sourcepub fn user_agent(self, ua: impl Into<String>) -> Self
pub fn user_agent(self, ua: impl Into<String>) -> Self
Set a custom user agent.
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 · 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
Source§impl Default for BrowserConfig
impl Default for BrowserConfig
Source§impl<'de> Deserialize<'de> for BrowserConfig
impl<'de> Deserialize<'de> for BrowserConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BrowserConfig
impl RefUnwindSafe for BrowserConfig
impl Send for BrowserConfig
impl Sync for BrowserConfig
impl Unpin 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