/// Spawn a given future onto the executor from the global level.
///
/// # Example
/// ```
/// # use bastion::prelude::*;
/// # #[cfg(feature = "tokio-runtime")]
/// # #[tokio::main]
/// # async fn main() {
/// #    run();    
/// # }
/// #
/// # #[cfg(not(feature = "tokio-runtime"))]
/// # fn main() {
/// #    run();    
/// # }
/// #
/// # fn run() {
/// use bastion::executor::{spawn, run};
/// let handle = spawn(async {
///     panic!("test");
/// });
/// run(handle);
/// # }
/// ```
Spawn a given future onto the executor from the global level.
Spawn a given future onto the executor from the global level .
pub fn spawn<F, T>(future: F) -> RecoverableHandle<T>
where
    F: Future<Output = T> + Send + 'static,
    T: Send + 'static,
{
    bastion_executor::pool::spawn(future, lightproc::proc_stack::ProcStack::default())
}
pub fn spawn < F , T > ( future : F ) -> RecoverableHandle < T > where F : Future < Output = T > + Send + ' static , T : Send + ' static , { bastion_executor :: pool :: spawn ( future , lightproc :: proc_stack :: ProcStack :: default ( ) ) }
Spawn a given future onto the executor from the global level.
Spawn a given future onto the executor from the global level .
future
F
example
None
use bastion::prelude::*;
None
#[cfg(feature = "tokio-runtime")]
None
#[tokio::main]
None
async fn main() {
None
run();    
None
}
None
#[cfg(not(feature = "tokio-runtime"))]
None
fn main() {
None
run();    
None
}
None
fn run() {
use bastion::executor::{spawn, run};
let handle = spawn(async {
panic!("test");
});
run(handle).
use bastion :: executor :: { spawn run } ; let handle = spawn ( async { panic! ( " test " ) ; } ) ; run ( handle ) .
}
None