Skip to content

Commit

Permalink
fixup! Make it Wasm compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Nov 13, 2024
1 parent 3957ec8 commit e0d6d21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions crates/matrix-sdk/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ impl Client {
/// ```
pub fn add_event_handler<Ev, Ctx, H>(&self, handler: H) -> EventHandlerHandle
where
Ev: SyncEvent + DeserializeOwned + Send + 'static,
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
H: EventHandler<Ev, Ctx>,
{
self.add_event_handler_impl(handler, None)
Expand All @@ -799,7 +799,7 @@ impl Client {
handler: H,
) -> EventHandlerHandle
where
Ev: SyncEvent + DeserializeOwned + Send + 'static,
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
H: EventHandler<Ev, Ctx>,
{
self.add_event_handler_impl(handler, Some(room_id.to_owned()))
Expand Down Expand Up @@ -839,8 +839,8 @@ impl Client {
/// [`EventHandlerSubscriber`]: crate::event_handler::EventHandlerSubscriber
pub fn observe_events<Ev, Ctx>(&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)
}
Expand All @@ -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()))
}
Expand All @@ -869,8 +869,8 @@ impl Client {
room_id: Option<OwnedRoomId>,
) -> 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.
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/event_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl Client {
room_id: Option<OwnedRoomId>,
) -> EventHandlerHandle
where
Ev: SyncEvent + DeserializeOwned + Send + 'static,
Ev: SyncEvent + DeserializeOwned + SendOutsideWasm + 'static,
H: EventHandler<Ev, Ctx>,
{
let handler_fn: Box<EventHandlerFn> = Box::new(move |data| {
Expand Down

0 comments on commit e0d6d21

Please sign in to comment.