Repository: bytebeamio/rumqtt (language: rust)

Issue:
TryRecvError is in private module v5::notifier and not reexported
This is a followup to #430. There some code was added to poll the notifier in v5. While trying it I ran into the snag mentioned above. This leads to this match statement not compiling:

```
use rumqttc::v5::{Client, MqttOptions, QoS, notifier::TryRecvError};

let rv = match connection.try_recv() {
    Ok(rv) => rv,
    Err(TryRecvError::Waiting) => break,
    Err(TryRecvError::Disconnected) => continue 'outer,
};
```

The problem is that TryRecvError needs to be importable to make a distinction between `Waiting` and `Disconnected`, but that is not possible due to visibility rules. I think it needs to be reexported somewhere.


Discussion / hints:

Fix patch:
diff --git a/rumqttc/src/v5/mod.rs b/rumqttc/src/v5/mod.rs
index 769da3c05..b5ecb79c1 100644
--- a/rumqttc/src/v5/mod.rs
+++ b/rumqttc/src/v5/mod.rs
@@ -19,7 +19,7 @@ mod tls;
 pub use client::{AsyncClient, Client, ClientError, Connection, Iter};
 pub use eventloop::{ConnectionError, EventLoop};
 pub use flume::{SendError, Sender, TrySendError};
-pub use notifier::Notifier;
+pub use notifier::{Notifier, TryRecvError};
 pub use packet::*;
 pub use state::{MqttState, StateError};
 #[cfg(feature = "use-rustls")]
diff --git a/rumqttc/src/v5/notifier.rs b/rumqttc/src/v5/notifier.rs
index 9b78ea648..0bd9e5ff4 100644
--- a/rumqttc/src/v5/notifier.rs
+++ b/rumqttc/src/v5/notifier.rs
@@ -8,11 +8,19 @@ use crate::v5::Incoming;
 #[derive(Debug, Eq, PartialEq)]
 pub enum TryRecvError {
     /// [`EventLoop`] is disconnected from broker
+    ///
+    /// [`EventLoop`]: super::EventLoop
     Disconnected,
     /// [`EventLoop`] is connected to broker
+    ///
+    /// [`EventLoop`]: super::EventLoop
     Waiting,
 }
 
+/// Interface to receive incoming [`Packet`]s from the [`EventLoop`]
+///
+/// [`Packet`]: super::Packet
+/// [`EventLoop`]: super::EventLoop
 #[derive(Debug)]
 pub struct Notifier {
     incoming_buf: Arc<Mutex<VecDeque<Incoming>>>,


Test patch: