From 5688b2e70a1ae4abb5b17ca1c985163b2013c1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 4 Dec 2019 22:35:19 +0100 Subject: [PATCH] async_client: Remove the response callbacks. --- src/async_client.rs | 19 ------------------- 1 file changed, 19 deletions(-) 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,