Skip to content

Commit d96cb78

Browse files
remove AsyncWriteExt mentions for smol too
1 parent 2536930 commit d96cb78

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

examples/tcp/src/ping_pong_smol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use mqrstt::{
22
packets::{self, Packet},
3-
AsyncEventHandler, ConnectOptions, MqttClient, NetworkBuilder, NetworkStatus,
3+
AsyncEventHandler, MqttClient, NetworkBuilder, NetworkStatus,
44
};
55
pub struct PingPong {
66
pub client: MqttClient,

mqrstt/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
`MQRSTT` is an MQTTv5 client that provides sync and async (smol and tokio) implementation.
1111

1212
Because this crate aims to be runtime agnostic the user is required to provide their own data stream.
13-
For an async approach the stream has to implement the smol or tokio [`AsyncReadExt`] and [`AsyncWriteExt`] traits.
14-
For a sync approach the stream has to implement the [`std::io::Read`] and [`std::io::Write`] traits.
13+
The stream has to implement the smol or tokio [`AsyncReadExt`] and [`AsyncWrite`] traits.
1514

1615
</div>
1716

mqrstt/src/packets/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub enum ReadError {
2020
IoError(#[from] std::io::Error),
2121
}
2222

23-
#[derive(Error, Clone, Debug, PartialEq, Eq)]
23+
#[derive(Error, Clone, Debug)]
2424
pub enum DeserializeError {
2525
#[error("Malformed packet: {0}")]
2626
MalformedPacketWithInfo(String),

mqrstt/src/smol/network.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{AsyncEventHandler, StateHandler};
1515

1616
use super::stream::Stream;
1717

18-
/// [`Network`] reads and writes to the network based on tokios [`::smol::io::AsyncReadExt`] [`::smol::io::AsyncWriteExt`].
18+
/// [`Network`] reads and writes to the network based on tokios [`::smol::io::AsyncRead`] [`::smol::io::AsyncWrite`].
1919
/// This way you can provide the `connect` function with a TLS and TCP stream of your choosing.
2020
/// The most import thing to remember is that you have to provide a new stream after the previous has failed.
2121
/// (i.e. you need to reconnect after any expected or unexpected disconnect).
@@ -62,7 +62,7 @@ impl<H, S> Network<H, S> {
6262
impl<H, S> Network<H, S>
6363
where
6464
H: AsyncEventHandler,
65-
S: smol::io::AsyncReadExt + smol::io::AsyncWriteExt + Sized + Unpin,
65+
S: smol::io::AsyncRead + smol::io::AsyncWrite + Sized + Unpin,
6666
{
6767
/// Initializes an MQTT connection with the provided configuration an stream
6868
pub async fn connect(&mut self, stream: S, handler: &mut H) -> Result<(), ConnectionError> {

0 commit comments

Comments
 (0)