From e0d6d21a03b780c37e644dd7585a6027b277b931 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 13 Nov 2024 08:16:15 +0100 Subject: [PATCH] fixup! Make it Wasm compatible. --- crates/matrix-sdk/src/client/mod.rs | 16 ++++++++-------- crates/matrix-sdk/src/event_handler/mod.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index b9461c8f4df..a56c9ace993 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -777,7 +777,7 @@ impl Client { /// ``` pub fn add_event_handler(&self, handler: H) -> EventHandlerHandle where - Ev: SyncEvent + DeserializeOwned + Send + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static, H: EventHandler, { self.add_event_handler_impl(handler, None) @@ -799,7 +799,7 @@ impl Client { handler: H, ) -> EventHandlerHandle where - Ev: SyncEvent + DeserializeOwned + Send + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static, H: EventHandler, { self.add_event_handler_impl(handler, Some(room_id.to_owned())) @@ -839,8 +839,8 @@ impl Client { /// [`EventHandlerSubscriber`]: crate::event_handler::EventHandlerSubscriber pub fn observe_events(&self) -> ObservableEventHandler<(Ev, Ctx)> where - Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static, - Ctx: EventHandlerContext + Send + Sync + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static, + Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static, { self.observe_room_events_impl(None) } @@ -856,8 +856,8 @@ impl Client { room_id: &RoomId, ) -> ObservableEventHandler<(Ev, Ctx)> where - Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static, - Ctx: EventHandlerContext + Send + Sync + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static, + Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static, { self.observe_room_events_impl(Some(room_id.to_owned())) } @@ -869,8 +869,8 @@ impl Client { room_id: Option, ) -> ObservableEventHandler<(Ev, Ctx)> where - Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static, - Ctx: EventHandlerContext + Send + Sync + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static, + Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static, { // The default value is `None`. It becomes `Some((Ev, Ctx))` once it has a // new value. diff --git a/crates/matrix-sdk/src/event_handler/mod.rs b/crates/matrix-sdk/src/event_handler/mod.rs index 8d33139ed35..83bffe2559f 100644 --- a/crates/matrix-sdk/src/event_handler/mod.rs +++ b/crates/matrix-sdk/src/event_handler/mod.rs @@ -291,7 +291,7 @@ impl Client { room_id: Option, ) -> EventHandlerHandle where - Ev: SyncEvent + DeserializeOwned + Send + 'static, + Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static, H: EventHandler, { let handler_fn: Box = Box::new(move |data| {