pub struct ChromedriverRunConfig { /* private fields */ }Expand description
Configuration used when running a ChromeDriver process.
Construct via Self::builder or Self::default. Defaults: latest stable Chrome,
OS-assigned port, no output listener, default cache directory, 3s graceful termination budget
on all systems.
let config = ChromedriverRunConfig::builder()
.version(Channel::Stable) // Accepts Channel, Version, or VersionRequest.
.port(8080u16) // Accepts u16, Port, or PortRequest.
.output_listener(DriverOutputListener::new(|line| println!("{line:?}")))
.graceful_shutdown(
GracefulShutdown::builder()
.unix_sigterm(Duration::from_secs(3))
.windows_ctrl_break(Duration::from_secs(3))
.build(),
)
.build();Implementations§
Source§impl ChromedriverRunConfig
impl ChromedriverRunConfig
Sourcepub fn builder() -> ChromedriverRunConfigBuilder<((), (), (), (), (), ())>
pub fn builder() -> ChromedriverRunConfigBuilder<((), (), (), (), (), ())>
Create a builder for building ChromedriverRunConfig.
On the builder, call .version(...)(optional), .chrome_binary(...)(optional), .port(...)(optional), .output_listener(...)(optional), .cache_dir(...)(optional), .graceful_shutdown(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ChromedriverRunConfig.
Source§impl ChromedriverRunConfig
impl ChromedriverRunConfig
Sourcepub const fn version(&self) -> &VersionRequest
pub const fn version(&self) -> &VersionRequest
The requested Chrome / ChromeDriver version.
Sourcepub const fn chrome_binary(&self) -> ChromeBinary
pub const fn chrome_binary(&self) -> ChromeBinary
The browser package to use with ChromeDriver.
Sourcepub const fn port(&self) -> PortRequest
pub const fn port(&self) -> PortRequest
The requested ChromeDriver port.
Sourcepub fn output_listener(&self) -> Option<&DriverOutputListener>
pub fn output_listener(&self) -> Option<&DriverOutputListener>
The optional process-output listener.
Sourcepub const fn graceful_shutdown(&self) -> &GracefulShutdown
pub const fn graceful_shutdown(&self) -> &GracefulShutdown
The graceful-shutdown budget used when terminating the ChromeDriver process.
Trait Implementations§
Source§impl Clone for ChromedriverRunConfig
impl Clone for ChromedriverRunConfig
Source§fn clone(&self) -> ChromedriverRunConfig
fn clone(&self) -> ChromedriverRunConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more