ckb_spawn/lib.rs
1//! `Spawn` abstract async runtime, spawns a future onto the runtime
2
3#![no_std]
4
5use core::future::Future;
6
7/// `Spawn` abstract async runtime, spawns a future onto the runtime
8#[cfg(not(target_family = "wasm"))]
9pub trait Spawn {
10 /// This spawns the given future onto the runtime's executor
11 fn spawn_task<F>(&self, task: F)
12 where
13 F: Future<Output = ()> + Send + 'static;
14}
15
16#[cfg(target_family = "wasm")]
17pub trait Spawn {
18 /// This spawns the given future onto the runtime's executor
19 fn spawn_task<F>(&self, task: F)
20 where
21 F: Future<Output = ()> + 'static;
22}