mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-28 02:01:20 +00:00
core/transport: Remove Sync
bounds (#2667)
With `Transport` becoming non-Clone and having `&mut` self receivers, the `Sync` requirement no longer makes any sense and we can thus remove it.
This commit is contained in:
parent
eba763443a
commit
4aa84bf7cd
@ -152,7 +152,7 @@ pub trait Transport {
|
||||
/// Boxes the transport, including custom transport errors.
|
||||
fn boxed(self) -> boxed::Boxed<Self::Output>
|
||||
where
|
||||
Self: Transport + Sized + Send + Sync + 'static,
|
||||
Self: Transport + Sized + Send + 'static,
|
||||
Self::Dial: Send + 'static,
|
||||
Self::Listener: Send + 'static,
|
||||
Self::ListenerUpgrade: Send + 'static,
|
||||
|
@ -26,7 +26,7 @@ use std::{error::Error, fmt, io, pin::Pin};
|
||||
/// Creates a new [`Boxed`] transport from the given transport.
|
||||
pub fn boxed<T>(transport: T) -> Boxed<T::Output>
|
||||
where
|
||||
T: Transport + Send + Sync + 'static,
|
||||
T: Transport + Send + 'static,
|
||||
T::Error: Send + Sync,
|
||||
T::Dial: Send + 'static,
|
||||
T::Listener: Send + 'static,
|
||||
@ -41,7 +41,7 @@ where
|
||||
/// and `ListenerUpgrade` futures are `Box`ed and only the `Output`
|
||||
/// and `Error` types are captured in type variables.
|
||||
pub struct Boxed<O> {
|
||||
inner: Box<dyn Abstract<O> + Send + Sync>,
|
||||
inner: Box<dyn Abstract<O> + Send>,
|
||||
}
|
||||
|
||||
type Dial<O> = Pin<Box<dyn Future<Output = io::Result<O>> + Send>>;
|
||||
|
@ -294,7 +294,7 @@ impl<T> Multiplexed<T> {
|
||||
/// the [`StreamMuxer`] and custom transport errors.
|
||||
pub fn boxed<M>(self) -> super::Boxed<(PeerId, StreamMuxerBox)>
|
||||
where
|
||||
T: Transport<Output = (PeerId, M)> + Sized + Send + Sync + 'static,
|
||||
T: Transport<Output = (PeerId, M)> + Sized + Send + 'static,
|
||||
T::Dial: Send + 'static,
|
||||
T::Listener: Send + 'static,
|
||||
T::ListenerUpgrade: Send + 'static,
|
||||
|
Loading…
x
Reference in New Issue
Block a user