2022-01-05 20:15:19 +00:00
|
|
|
use std::path::PathBuf;
|
2021-12-26 20:18:42 +00:00
|
|
|
|
2018-03-24 08:00:38 +00:00
|
|
|
use url::Url;
|
2017-08-03 18:31:15 +00:00
|
|
|
|
2018-02-11 11:37:08 +00:00
|
|
|
#[derive(Clone, Debug)]
|
2017-08-03 18:58:44 +00:00
|
|
|
pub struct SessionConfig {
|
|
|
|
pub device_id: String,
|
2018-03-24 08:00:38 +00:00
|
|
|
pub proxy: Option<Url>,
|
2018-07-03 11:09:22 +00:00
|
|
|
pub ap_port: Option<u16>,
|
2021-12-17 19:58:05 +00:00
|
|
|
pub tmp_dir: PathBuf,
|
2017-08-03 18:58:44 +00:00
|
|
|
}
|
|
|
|
|
2021-03-06 00:29:08 +00:00
|
|
|
impl Default for SessionConfig {
|
|
|
|
fn default() -> SessionConfig {
|
|
|
|
let device_id = uuid::Uuid::new_v4().to_hyphenated().to_string();
|
|
|
|
SessionConfig {
|
|
|
|
device_id,
|
|
|
|
proxy: None,
|
|
|
|
ap_port: None,
|
2021-12-17 19:58:05 +00:00
|
|
|
tmp_dir: std::env::temp_dir(),
|
2021-03-06 00:29:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|