File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -277,15 +277,21 @@ impl TaskPool {
277
277
/// the browser. Consider using [`spawn_blocking_async`] instead.
278
278
///
279
279
/// [`spawn_blocking_async`]: Self::spawn_blocking_async
280
- pub fn spawn_blocking < T > ( & self , f : impl FnOnce ( ) -> T + ' static ) -> Task < T >
280
+ pub fn spawn_blocking < T > (
281
+ & self ,
282
+ f : impl FnOnce ( ) -> T + ' static + MaybeSend + MaybeSync ,
283
+ ) -> Task < T >
281
284
where
282
285
T : ' static + MaybeSend + MaybeSync ,
283
286
{
284
287
self . spawn ( async { f ( ) } )
285
288
}
286
289
287
290
/// Spawns a static future on the JS event loop. This is exactly the same as [`TaskPool::spawn`].
288
- pub fn spawn_blocking_async < T > ( & self , future : impl Future < Output = T > + ' static ) -> Task < T >
291
+ pub fn spawn_blocking_async < T > (
292
+ & self ,
293
+ future : impl Future < Output = T > + ' static + MaybeSend + MaybeSync ,
294
+ ) -> Task < T >
289
295
where
290
296
T : ' static + MaybeSend + MaybeSync ,
291
297
{
You can’t perform that action at this time.
0 commit comments