1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use crate::executor::{BlockingObj, FutureObj}; use crate::{App, Spawn}; impl<S> App<S, ()> { /// Construct app with default runtime. /// /// Feature `runtime` is required. #[inline] pub fn new(state: S) -> Self { Self::with_exec(state, Exec) } } pub struct Exec; impl Spawn for Exec { #[inline] fn spawn(&self, fut: FutureObj) { async_std::task::spawn(fut); } #[inline] fn spawn_blocking(&self, task: BlockingObj) { async_std::task::spawn_blocking(task); } }