Skip to content

Commit 1f0b762

Browse files
authored
Merge pull request #5 from mohe2015/make-cloneable
Make `WebDriverBiDiSession` cloneable
2 parents 27419e1 + 0444b0e commit 1f0b762

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub type EventHandler =
6666
/// * `websocket_stream` - The WebSocket stream for communication protected by an `Arc` wrapped `Mutex`.
6767
/// * `pending_commands` - A map of pending commands awaiting responses protected by an `Arc` wrapped `Mutex`.
6868
/// * `event_handlers` - A map of events and their handlers protected by an `Arc` wrapped `Mutex`.
69+
#[derive(Clone)]
6970
pub struct WebDriverBiDiSession {
7071
pub host: String,
7172
pub port: u16,

src/webdriver/capabilities.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use serde_json::{json, Value};
1414
pub type Extensible = HashMap<String, Value>;
1515

1616
/// Standard WebDriver capabilities https://w3c.github.io/webdriver/#capabilities.
17-
#[derive(Debug, Serialize, Deserialize)]
17+
#[derive(Debug, Serialize, Deserialize, Clone)]
1818
#[serde(rename_all = "camelCase")]
1919
pub struct CapabilityRequest {
2020
#[serde(skip_serializing_if = "Option::is_none")]
@@ -77,7 +77,7 @@ impl CapabilityRequest {
7777
// --------------------------------------------------
7878

7979
/// Capabilities struct to represent the standard capabilities JSON object.
80-
#[derive(Debug, Serialize, Deserialize)]
80+
#[derive(Debug, Serialize, Deserialize, Clone)]
8181
pub struct CapabilitiesRequest {
8282
#[serde(rename = "alwaysMatch", skip_serializing_if = "Option::is_none")]
8383
always_match: Option<CapabilityRequest>,

0 commit comments

Comments
 (0)