Add mtu option

This commit is contained in:
Kevin Yue
2024-02-10 18:19:37 +08:00
parent 3736189308
commit 66bcccabe4
7 changed files with 41 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ pub struct ConnectArgs {
user_agent: Option<String>,
csd_uid: u32,
csd_wrapper: Option<String>,
mtu: u32,
os: Option<ClientOs>,
}
@@ -46,6 +47,7 @@ impl ConnectArgs {
os: None,
csd_uid: 0,
csd_wrapper: None,
mtu: 0,
}
}
@@ -72,6 +74,10 @@ impl ConnectArgs {
pub fn csd_wrapper(&self) -> Option<String> {
self.csd_wrapper.clone()
}
pub fn mtu(&self) -> u32 {
self.mtu
}
}
#[derive(Debug, Deserialize, Serialize, Type)]
@@ -103,6 +109,11 @@ impl ConnectRequest {
self
}
pub fn with_mtu(mut self, mtu: u32) -> Self {
self.args.mtu = mtu;
self
}
pub fn with_user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self {
self.args.user_agent = user_agent.into();
self