Unverified 提交 38ff617f authored 作者: satoren's avatar satoren

feat: Add Send trait to future for transport trait

上级 6acce099
...@@ -228,7 +228,7 @@ impl fmt::Debug for DirectTransport { ...@@ -228,7 +228,7 @@ impl fmt::Debug for DirectTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl Transport for DirectTransport { impl Transport for DirectTransport {
/// Transport id. /// Transport id.
fn id(&self) -> TransportId { fn id(&self) -> TransportId {
...@@ -385,7 +385,7 @@ impl Transport for DirectTransport { ...@@ -385,7 +385,7 @@ impl Transport for DirectTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl TransportGeneric for DirectTransport { impl TransportGeneric for DirectTransport {
type Dump = DirectTransportDump; type Dump = DirectTransportDump;
type Stat = DirectTransportStat; type Stat = DirectTransportStat;
......
...@@ -271,7 +271,7 @@ impl fmt::Debug for PipeTransport { ...@@ -271,7 +271,7 @@ impl fmt::Debug for PipeTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl Transport for PipeTransport { impl Transport for PipeTransport {
fn id(&self) -> TransportId { fn id(&self) -> TransportId {
self.inner.id self.inner.id
...@@ -414,7 +414,7 @@ impl Transport for PipeTransport { ...@@ -414,7 +414,7 @@ impl Transport for PipeTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl TransportGeneric for PipeTransport { impl TransportGeneric for PipeTransport {
type Dump = PipeTransportDump; type Dump = PipeTransportDump;
type Stat = PipeTransportStat; type Stat = PipeTransportStat;
......
...@@ -301,7 +301,7 @@ impl fmt::Debug for PlainTransport { ...@@ -301,7 +301,7 @@ impl fmt::Debug for PlainTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl Transport for PlainTransport { impl Transport for PlainTransport {
fn id(&self) -> TransportId { fn id(&self) -> TransportId {
self.inner.id self.inner.id
...@@ -444,7 +444,7 @@ impl Transport for PlainTransport { ...@@ -444,7 +444,7 @@ impl Transport for PlainTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl TransportGeneric for PlainTransport { impl TransportGeneric for PlainTransport {
type Dump = PlainTransportDump; type Dump = PlainTransportDump;
type Stat = PlainTransportStat; type Stat = PlainTransportStat;
......
...@@ -149,7 +149,7 @@ pub(super) enum TransportType { ...@@ -149,7 +149,7 @@ pub(super) enum TransportType {
/// * [`DirectTransport`](crate::direct_transport::DirectTransport) /// * [`DirectTransport`](crate::direct_transport::DirectTransport)
/// ///
/// For additional methods see [`TransportGeneric`]. /// For additional methods see [`TransportGeneric`].
#[async_trait(?Send)] #[async_trait]
pub trait Transport: Debug + Send + Sync + private::CloneTransport { pub trait Transport: Debug + Send + Sync + private::CloneTransport {
/// Transport id. /// Transport id.
#[must_use] #[must_use]
...@@ -282,7 +282,7 @@ impl Clone for Box<dyn Transport> { ...@@ -282,7 +282,7 @@ impl Clone for Box<dyn Transport> {
} }
/// Generic transport trait with methods available on all transports in addition to [`Transport`]. /// Generic transport trait with methods available on all transports in addition to [`Transport`].
#[async_trait(?Send)] #[async_trait]
pub trait TransportGeneric: Transport + Clone + 'static { pub trait TransportGeneric: Transport + Clone + 'static {
/// Dump data structure specific to each transport. /// Dump data structure specific to each transport.
#[doc(hidden)] #[doc(hidden)]
...@@ -360,7 +360,7 @@ pub enum ConsumeDataError { ...@@ -360,7 +360,7 @@ pub enum ConsumeDataError {
Request(RequestError), Request(RequestError),
} }
#[async_trait(?Send)] #[async_trait]
pub(super) trait TransportImpl: TransportGeneric { pub(super) trait TransportImpl: TransportGeneric {
fn router(&self) -> &Router; fn router(&self) -> &Router;
......
...@@ -356,7 +356,7 @@ impl fmt::Debug for WebRtcTransport { ...@@ -356,7 +356,7 @@ impl fmt::Debug for WebRtcTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl Transport for WebRtcTransport { impl Transport for WebRtcTransport {
fn id(&self) -> TransportId { fn id(&self) -> TransportId {
self.inner.id self.inner.id
...@@ -499,7 +499,7 @@ impl Transport for WebRtcTransport { ...@@ -499,7 +499,7 @@ impl Transport for WebRtcTransport {
} }
} }
#[async_trait(?Send)] #[async_trait]
impl TransportGeneric for WebRtcTransport { impl TransportGeneric for WebRtcTransport {
type Dump = WebRtcTransportDump; type Dump = WebRtcTransportDump;
type Stat = WebRtcTransportStat; type Stat = WebRtcTransportStat;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论