diff --git a/src/async_client.rs b/src/async_client.rs index 1d07bb01..2901c3fc 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -29,9 +29,6 @@ use crate::VERSION; type RoomEventCallback = Box>, Arc>) -> BoxFuture<'static, ()> + Send>; -type ResponseCallback = - Box) -> BoxFuture<'static, ()> + Send>; - #[derive(Clone)] pub struct AsyncClient { /// The URL of the homeserver to connect to. @@ -44,8 +41,6 @@ pub struct AsyncClient { transaction_id: Arc, /// Event callbacks event_callbacks: Arc>>, - // /// Response callbacks. - response_callbacks: Arc>>, } #[derive(Default, Debug)] @@ -162,7 +157,6 @@ impl AsyncClient { base_client: Arc::new(RwLock::new(BaseClient::new(session))), transaction_id: Arc::new(AtomicU64::new(0)), event_callbacks: Arc::new(Mutex::new(Vec::new())), - response_callbacks: Arc::new(Mutex::new(Vec::new())), }) } @@ -183,19 +177,6 @@ impl AsyncClient { futures.push(Box::new(future)); } - pub fn add_response_callback( - &mut self, - mut callback: impl FnMut(Arc) -> C + 'static + Send, - ) where - C: Future + Send, - { - let mut futures = self.response_callbacks.lock().unwrap(); - - let future = move |response| callback(response).boxed(); - - futures.push(Box::new(future)); - } - pub async fn login>( &mut self, user: S,