pub struct ChromedriverRunConfig {
pub version: VersionRequest,
pub port: PortRequest,
pub output_listener: Option<DriverOutputListener>,
pub cache_dir: Option<PathBuf>,
pub graceful_shutdown: GracefulShutdown,
}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();Fields§
§version: VersionRequestThe requested ChromeDriver version.
Accepts anything implementing Into<VersionRequest>, including Channel and
crate::Version.
port: PortRequestThe requested ChromeDriver port.
Accepts anything implementing Into<PortRequest>, including a bare u16 and Port.
output_listener: Option<DriverOutputListener>Optional callback for browser-driver process output lines.
cache_dir: Option<PathBuf>Optional override for the cache directory holding downloaded chrome / chromedriver artifacts. Defaults to the platform’s per-user cache directory.
graceful_shutdown: GracefulShutdownPer-platform graceful-shutdown budget applied when the Chromedriver handle is dropped
or Chromedriver::terminate is called.
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), .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.
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