use serde::{Deserialize, Serialize};
#[deprecated(since = "0.37.0", note = "use thirtyfour::cdp::domains::network::ConnectionType")]
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub enum ConnectionType {
None,
Cellular2G,
Cellular3G,
Cellular4G,
Bluetooth,
Ethernet,
Wifi,
Wimax,
Other,
}
#[deprecated(
since = "0.37.0",
note = "use thirtyfour::cdp::domains::network::NetworkConditions via WebDriver::cdp().network()"
)]
#[allow(deprecated)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NetworkConditions {
pub offline: bool,
pub latency: u32,
pub download_throughput: i32,
pub upload_throughput: i32,
#[serde(skip_serializing_if = "Option::is_none")]
pub connection_type: Option<ConnectionType>,
}
#[allow(deprecated)]
impl Default for NetworkConditions {
fn default() -> Self {
Self {
offline: false,
latency: 0,
download_throughput: -1,
upload_throughput: -1,
connection_type: None,
}
}
}
#[allow(deprecated)]
impl NetworkConditions {
pub fn new() -> Self {
Self::default()
}
}