pub struct DriverBuilder { /* private fields */ }Expand description
Builder for configuring a Driver instance.
Use Driver::builder() to create a new builder.
Implementations§
Source§impl DriverBuilder
impl DriverBuilder
Sourcepub fn binary(self, path: impl Into<PathBuf>) -> Self
pub fn binary(self, path: impl Into<PathBuf>) -> Self
Sets the path to the Firefox binary executable.
§Arguments
path- Path to Firefox binary (e.g., “/usr/bin/firefox”)
Sourcepub fn extension(self, path: impl Into<PathBuf>) -> Self
pub fn extension(self, path: impl Into<PathBuf>) -> Self
Sets the path to the WebDriver extension.
Automatically detects whether the path is a directory (unpacked) or file (packed .xpi).
§Arguments
path- Path to extension directory or .xpi file
Sourcepub fn extension_base64(self, data: impl Into<String>) -> Self
pub fn extension_base64(self, data: impl Into<String>) -> Self
Sets the extension from a base64-encoded string.
Useful for embedding the extension in the binary.
§Arguments
data- Base64-encoded .xpi content
Sourcepub fn extension_source(self, source: ExtensionSource) -> Self
pub fn extension_source(self, source: ExtensionSource) -> Self
Sourcepub async fn build(self) -> Result<Driver>
pub async fn build(self) -> Result<Driver>
Builds the driver with validation.
This is an async operation because it binds the WebSocket server.
§Errors
Error::Configif binary or extension not setError::FirefoxNotFoundif binary path doesn’t existError::Configif extension path doesn’t existError::Ioif WebSocket server binding fails
Trait Implementations§
Source§impl Clone for DriverBuilder
impl Clone for DriverBuilder
Source§fn clone(&self) -> DriverBuilder
fn clone(&self) -> DriverBuilder
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 DriverBuilder
impl Debug for DriverBuilder
Source§impl Default for DriverBuilder
impl Default for DriverBuilder
Source§fn default() -> DriverBuilder
fn default() -> DriverBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DriverBuilder
impl RefUnwindSafe for DriverBuilder
impl Send for DriverBuilder
impl Sync for DriverBuilder
impl Unpin for DriverBuilder
impl UnwindSafe for DriverBuilder
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