pub trait BraidRuntime:
Send
+ Sync
+ 'static {
// Required methods
fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>);
fn sleep(
&self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>>;
fn now_ms(&self) -> u64;
}Expand description
Abstraction for asynchronous runtime operations.
Required Methods§
Sourcefn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>)
fn spawn(&self, future: Pin<Box<dyn Future<Output = ()> + Send + 'static>>)
Spawn a background task.
Implementors§
impl BraidRuntime for NativeRuntime
Available on crate feature
native and non-WebAssembly only.