tokio-xmpp: derive Debug on multiple structures

Maxime “pep” Buquet created

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>

Change summary

tokio-xmpp/ChangeLog               | 1 +
tokio-xmpp/src/client/iq.rs        | 6 ++++++
tokio-xmpp/src/client/mod.rs       | 1 +
tokio-xmpp/src/stanzastream/mod.rs | 1 +
4 files changed, 9 insertions(+)

Detailed changes

tokio-xmpp/ChangeLog 🔗

@@ -39,6 +39,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
         Future.
       - `rustls` is now re-exported if it is enabled, to allow applications to
         set the default crypto provider if needed. (!581)
+      - Derive Debug on Client and associated structs
     * Changes:
       - On Linux, once the TLS session is established, we can delegate the
         actual encryption and decryption to the kernel, which in turn can

tokio-xmpp/src/client/iq.rs 🔗

@@ -31,6 +31,7 @@ use crate::{
 };
 
 /// An IQ request payload
+#[derive(Debug)]
 pub enum IqRequest {
     /// Payload for a `type="get"` request
     Get(Element),
@@ -49,6 +50,7 @@ impl From<IqRequest> for IqType {
 }
 
 /// An IQ response payload
+#[derive(Debug)]
 pub enum IqResponse {
     /// Payload for a `type="result"` response.
     Result(Option<Element>),
@@ -102,6 +104,7 @@ impl Error for IqFailure {
 type IqKey = (Option<Jid>, String);
 type IqMap = BTreeMap<IqKey, IqResponseSink>;
 
+#[derive(Debug)]
 struct IqMapEntryHandle {
     key: IqKey,
     map: Weak<Mutex<IqMap>>,
@@ -134,6 +137,7 @@ pin_project_lite::pin_project! {
     ///
     /// Dropping (cancelling) an `IqResponseToken` removes the internal
     /// bookkeeping required for tracking the response.
+    #[derive(Debug)]
     pub struct IqResponseToken {
         entry: Option<IqMapEntryHandle>,
         #[pin]
@@ -217,6 +221,7 @@ impl Future for IqResponseToken {
     }
 }
 
+#[derive(Debug)]
 struct IqResponseSink {
     inner: oneshot::Sender<Result<IqResponse, IqFailure>>,
 }
@@ -228,6 +233,7 @@ impl IqResponseSink {
 }
 
 /// Utility struct to track IQ responses.
+#[derive(Debug)]
 pub struct IqResponseTracker {
     map: Arc<Mutex<IqMap>>,
 }

tokio-xmpp/src/client/mod.rs 🔗

@@ -36,6 +36,7 @@ pub use iq::{IqFailure, IqRequest, IqResponse, IqResponseToken};
 ///
 /// To send stanzas, the [`send_stanza`][`Client::send_stanza`] method can be
 /// used.
+#[derive(Debug)]
 pub struct Client {
     stream: StanzaStream,
     bound_jid: Option<Jid>,

tokio-xmpp/src/stanzastream/mod.rs 🔗

@@ -90,6 +90,7 @@ pub enum Event {
 }
 
 /// Frontend interface to a reliable, always-online stanza stream.
+#[derive(Debug)]
 pub struct StanzaStream {
     rx: mpsc::Receiver<Event>,
     tx: mpsc::Sender<QueueEntry>,