ckb_spawn/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! `Spawn` abstract async runtime, spawns a future onto the runtime

#![no_std]

use core::future::Future;

/// `Spawn` abstract async runtime, spawns a future onto the runtime
#[cfg(not(target_family = "wasm"))]
pub trait Spawn {
    /// This spawns the given future onto the runtime's executor
    fn spawn_task<F>(&self, task: F)
    where
        F: Future<Output = ()> + Send + 'static;
}

#[cfg(target_family = "wasm")]
pub trait Spawn {
    /// This spawns the given future onto the runtime's executor
    fn spawn_task<F>(&self, task: F)
    where
        F: Future<Output = ()> + 'static;
}