Added doc comment for wait_for_events
Some checks are pending
Build / lint (push) Waiting to run
Build / test-stable (push) Blocked by required conditions
Build / test-nightly (push) Blocked by required conditions

This commit is contained in:
Werner Kroneman 2023-12-03 22:51:36 +01:00 committed by pep
parent 12d102b39c
commit 176d213e0f

View file

@ -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<Vec<Event>> {
if let Some(event) = self.client.next().await {
let mut events = Vec::new();