From 8c239e5c7a49cff350104b09cbb74d862c2ec420 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 26 Mar 2025 19:13:10 +0000 Subject: feat: stream error handling --- lampada/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lampada/src/lib.rs') diff --git a/lampada/src/lib.rs b/lampada/src/lib.rs index c61c596..a01ba06 100644 --- a/lampada/src/lib.rs +++ b/lampada/src/lib.rs @@ -15,6 +15,7 @@ use stanza::client::{ iq::{self, Iq, IqType}, Stanza, }; +use stanza::stream::Error as StreamError; use tokio::{ sync::{mpsc, oneshot, Mutex}, task::JoinSet, @@ -59,12 +60,16 @@ pub trait Logic { connection: Connected, ) -> impl std::future::Future + Send; + fn handle_stream_error( + self, + stream_error: StreamError, + ) -> impl std::future::Future + Send; + /// run to handle an incoming xmpp stanza fn handle_stanza( self, stanza: Stanza, connection: Connected, - supervisor: SupervisorSender, ) -> impl std::future::Future + std::marker::Send; /// run to handle a command message when a connection is currently established -- cgit