/// Block the current thread until passed
/// future is resolved with an output (including the panic).
///
/// # 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::run;
/// let future1 = async move {
///     123
/// };
///
/// run(async move {
///     let result = future1.await;
///     assert_eq!(result, 123);
/// });
///
/// let future2 = async move {
///     10 / 2
/// };
///
/// let result = run(future2);
/// assert_eq!(result, 5);
/// # }
/// ```
Block the current thread until passed
future is resolved with an output (including the panic).
Block the current thread until passed future is resolved with an output ( including the panic ) .
pub fn run<F, T>(future: F) -> T
where
    F: Future<Output = T>,
{
    bastion_executor::run::run(future, lightproc::proc_stack::ProcStack::default())
}
pub fn run < F , T > ( future : F ) -> T where F : Future < Output = T > , { bastion_executor :: run :: run ( future , lightproc :: proc_stack :: ProcStack :: default ( ) ) }
Block the current thread until passed
future is resolved with an output (including the panic).
Block the current thread until passed future is resolved with an output ( including the panic ) .
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::run;
let future1 = async move {
123
}.

run(async move {
let result = future1.await;
assert_eq!(result, 123);
}).

let future2 = async move {
10 / 2
}.

let result = run(future2);
assert_eq!(result, 5).
use bastion :: executor :: run ; let future1 = async move { 123 } . run ( async move { let result = future1 . await ; assert_eq! ( result 123 ) ; } ) . let future2 = async move { 10 / 2 } . let result = run ( future2 ) ; assert_eq! ( result 5 ) .
}
None