From 176d213e0fb4c5bca696cdb35d49ddabb50fea1a Mon Sep 17 00:00:00 2001 From: Werner Kroneman Date: Sun, 3 Dec 2023 22:51:36 +0100 Subject: [PATCH] Added doc comment for wait_for_events --- xmpp/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index 493136a..65daa4c 100644 --- a/xmpp/src/lib.rs +++ b/xmpp/src/lib.rs @@ -441,6 +441,12 @@ impl Agent { events } + /// Wait for new events. + /// + /// # Returns + /// + /// - `Some(events)` if there are new events; multiple may be returned at once. + /// - `None` if the underlying stream is closed. pub async fn wait_for_events(&mut self) -> Option> { if let Some(event) = self.client.next().await { let mut events = Vec::new();