Skip to main content

reqwest_lb/
runtime.rs

1use std::future::Future;
2
3pub trait Runtime {
4    fn spawn<F>(future: F)
5    where
6        F: Future + Send + 'static,
7        F::Output: Send + 'static;
8}
9
10#[derive(Debug, Clone, Copy, Default)]
11pub struct Tokio;
12
13impl Runtime for Tokio {
14    fn spawn<F>(future: F)
15    where
16        F: Future + Send + 'static,
17        F::Output: Send + 'static,
18    {
19        tokio::spawn(future);
20    }
21}