async_ui_core/
mount.rs

1use std::future::Future;
2
3use scoped_async_spawn::GiveUnforgettableScope;
4
5use crate::{
6    backend::BackendTrait,
7    executor::{get_driving_future, spawn_local},
8};
9
10pub fn mount<B: BackendTrait, F: Future<Output = ()> + 'static>(fut: F) {
11    spawn_local(GiveUnforgettableScope::new_static(fut)).detach();
12    B::drive_executor(get_driving_future());
13}