Unverified 提交 3d4ef192 authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi 提交者: GitHub

Merge pull request #877 from nazar-pc/rust-transport-internal-cleanup

Cleanup `internal` field in transport in Rust
...@@ -52,10 +52,6 @@ pub(crate) struct WebRtcServerInternal { ...@@ -52,10 +52,6 @@ pub(crate) struct WebRtcServerInternal {
pub(crate) struct TransportInternal { pub(crate) struct TransportInternal {
pub(crate) router_id: RouterId, pub(crate) router_id: RouterId,
pub(crate) transport_id: TransportId, pub(crate) transport_id: TransportId,
// TODO: This field should have really been in the `data`, not in `internal` data structure
#[serde(rename = "webRtcServerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) webrtc_server_id: Option<WebRtcServerId>,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
......
...@@ -572,7 +572,6 @@ impl Router { ...@@ -572,7 +572,6 @@ impl Router {
internal: TransportInternal { internal: TransportInternal {
router_id: self.inner.id, router_id: self.inner.id,
transport_id, transport_id,
webrtc_server_id: None,
}, },
data: RouterCreateDirectTransportData::from_options(&direct_transport_options), data: RouterCreateDirectTransportData::from_options(&direct_transport_options),
}) })
...@@ -634,10 +633,6 @@ impl Router { ...@@ -634,10 +633,6 @@ impl Router {
internal: TransportInternal { internal: TransportInternal {
router_id: self.inner.id, router_id: self.inner.id,
transport_id, transport_id,
webrtc_server_id: match &webrtc_transport_options.listen {
WebRtcTransportListen::Individual { .. } => None,
WebRtcTransportListen::Server { webrtc_server } => Some(webrtc_server.id()),
},
}, },
data: RouterCreateWebrtcTransportData::from_options(&webrtc_transport_options), data: RouterCreateWebrtcTransportData::from_options(&webrtc_transport_options),
}) })
...@@ -702,7 +697,6 @@ impl Router { ...@@ -702,7 +697,6 @@ impl Router {
internal: TransportInternal { internal: TransportInternal {
router_id: self.inner.id, router_id: self.inner.id,
transport_id, transport_id,
webrtc_server_id: None,
}, },
data: RouterCreatePipeTransportData::from_options(&pipe_transport_options), data: RouterCreatePipeTransportData::from_options(&pipe_transport_options),
}) })
...@@ -763,7 +757,6 @@ impl Router { ...@@ -763,7 +757,6 @@ impl Router {
internal: TransportInternal { internal: TransportInternal {
router_id: self.inner.id, router_id: self.inner.id,
transport_id, transport_id,
webrtc_server_id: None,
}, },
data: RouterCreatePlainTransportData::from_options(&plain_transport_options), data: RouterCreatePlainTransportData::from_options(&plain_transport_options),
}) })
......
...@@ -172,7 +172,6 @@ impl Inner { ...@@ -172,7 +172,6 @@ impl Inner {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router.id(), router_id: self.router.id(),
transport_id: self.id, transport_id: self.id,
webrtc_server_id: None,
}, },
}; };
...@@ -541,7 +540,6 @@ impl DirectTransport { ...@@ -541,7 +540,6 @@ impl DirectTransport {
TransportInternal { TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
} }
} }
} }
......
...@@ -223,7 +223,6 @@ impl Inner { ...@@ -223,7 +223,6 @@ impl Inner {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router.id(), router_id: self.router.id(),
transport_id: self.id, transport_id: self.id,
webrtc_server_id: None,
}, },
}; };
...@@ -646,7 +645,6 @@ impl PipeTransport { ...@@ -646,7 +645,6 @@ impl PipeTransport {
TransportInternal { TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
} }
} }
} }
......
...@@ -260,7 +260,6 @@ impl Inner { ...@@ -260,7 +260,6 @@ impl Inner {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router.id(), router_id: self.router.id(),
transport_id: self.id, transport_id: self.id,
webrtc_server_id: None,
}, },
}; };
...@@ -821,7 +820,6 @@ impl PlainTransport { ...@@ -821,7 +820,6 @@ impl PlainTransport {
TransportInternal { TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
} }
} }
} }
......
...@@ -372,7 +372,6 @@ pub(super) trait TransportImpl: TransportGeneric { ...@@ -372,7 +372,6 @@ pub(super) trait TransportImpl: TransportGeneric {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
}, },
}) })
.await .await
...@@ -384,7 +383,6 @@ pub(super) trait TransportImpl: TransportGeneric { ...@@ -384,7 +383,6 @@ pub(super) trait TransportImpl: TransportGeneric {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
}, },
}) })
.await .await
...@@ -396,7 +394,6 @@ pub(super) trait TransportImpl: TransportGeneric { ...@@ -396,7 +394,6 @@ pub(super) trait TransportImpl: TransportGeneric {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
}, },
data: TransportSetMaxIncomingBitrateData { bitrate }, data: TransportSetMaxIncomingBitrateData { bitrate },
}) })
...@@ -409,7 +406,6 @@ pub(super) trait TransportImpl: TransportGeneric { ...@@ -409,7 +406,6 @@ pub(super) trait TransportImpl: TransportGeneric {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
}, },
data: TransportSetMaxOutgoingBitrateData { bitrate }, data: TransportSetMaxOutgoingBitrateData { bitrate },
}) })
...@@ -425,7 +421,6 @@ pub(super) trait TransportImpl: TransportGeneric { ...@@ -425,7 +421,6 @@ pub(super) trait TransportImpl: TransportGeneric {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
}, },
data: TransportEnableTraceEventData { types }, data: TransportEnableTraceEventData { types },
}) })
......
...@@ -347,7 +347,6 @@ impl Inner { ...@@ -347,7 +347,6 @@ impl Inner {
internal: TransportInternal { internal: TransportInternal {
router_id: self.router.id(), router_id: self.router.id(),
transport_id: self.id, transport_id: self.id,
webrtc_server_id: None,
}, },
}; };
...@@ -942,7 +941,6 @@ impl WebRtcTransport { ...@@ -942,7 +941,6 @@ impl WebRtcTransport {
TransportInternal { TransportInternal {
router_id: self.router().id(), router_id: self.router().id(),
transport_id: self.id(), transport_id: self.id(),
webrtc_server_id: None,
} }
} }
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论