Skip to content

Commit e0d6d21

Browse files
committed
fixup! Make it Wasm compatible.
1 parent 3957ec8 commit e0d6d21

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

crates/matrix-sdk/src/client/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ impl Client {
777777
/// ```
778778
pub fn add_event_handler<Ev, Ctx, H>(&self, handler: H) -> EventHandlerHandle
779779
where
780-
Ev: SyncEvent + DeserializeOwned + Send + 'static,
780+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
781781
H: EventHandler<Ev, Ctx>,
782782
{
783783
self.add_event_handler_impl(handler, None)
@@ -799,7 +799,7 @@ impl Client {
799799
handler: H,
800800
) -> EventHandlerHandle
801801
where
802-
Ev: SyncEvent + DeserializeOwned + Send + 'static,
802+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
803803
H: EventHandler<Ev, Ctx>,
804804
{
805805
self.add_event_handler_impl(handler, Some(room_id.to_owned()))
@@ -839,8 +839,8 @@ impl Client {
839839
/// [`EventHandlerSubscriber`]: crate::event_handler::EventHandlerSubscriber
840840
pub fn observe_events<Ev, Ctx>(&self) -> ObservableEventHandler<(Ev, Ctx)>
841841
where
842-
Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static,
843-
Ctx: EventHandlerContext + Send + Sync + 'static,
842+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static,
843+
Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static,
844844
{
845845
self.observe_room_events_impl(None)
846846
}
@@ -856,8 +856,8 @@ impl Client {
856856
room_id: &RoomId,
857857
) -> ObservableEventHandler<(Ev, Ctx)>
858858
where
859-
Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static,
860-
Ctx: EventHandlerContext + Send + Sync + 'static,
859+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static,
860+
Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static,
861861
{
862862
self.observe_room_events_impl(Some(room_id.to_owned()))
863863
}
@@ -869,8 +869,8 @@ impl Client {
869869
room_id: Option<OwnedRoomId>,
870870
) -> ObservableEventHandler<(Ev, Ctx)>
871871
where
872-
Ev: SyncEvent + DeserializeOwned + Send + Sync + 'static,
873-
Ctx: EventHandlerContext + Send + Sync + 'static,
872+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + SyncOutsideWasm + 'static,
873+
Ctx: EventHandlerContext + SendOutsideWasm + SyncOutsideWasm + 'static,
874874
{
875875
// The default value is `None`. It becomes `Some((Ev, Ctx))` once it has a
876876
// new value.

crates/matrix-sdk/src/event_handler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl Client {
291291
room_id: Option<OwnedRoomId>,
292292
) -> EventHandlerHandle
293293
where
294-
Ev: SyncEvent + DeserializeOwned + Send + 'static,
294+
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
295295
H: EventHandler<Ev, Ctx>,
296296
{
297297
let handler_fn: Box<EventHandlerFn> = Box::new(move |data| {

0 commit comments

Comments
 (0)