diff --git a/rumqttc/src/framed.rs b/rumqttc/src/framed.rs index ec0e6ba6d..71d111d36 100644 --- a/rumqttc/src/framed.rs +++ b/rumqttc/src/framed.rs @@ -92,5 +92,11 @@ impl Network { } } -pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Sync + Unpin {} -impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Sync + Unpin {} +#[cfg(not(feature = "websocket"))] +pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(not(feature = "websocket"))] +impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(feature = "websocket")] +pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(feature = "websocket")] +impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Unpin {}