portablemc 5.0.3

Developer-oriented crate for launching Minecraft quickly and reliably with included support for Mojang versions and popular mod loaders. See portablemc-cli for the reference implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Async utilities around Tokio runtime.

use std::future::Future;


/// Block on the given future with the Tokio runtime with time and I/O enabled.
pub fn sync<F: Future>(future: F) -> F::Output {
    
    let rt = tokio::runtime::Builder::new_current_thread()
        .enable_time()
        .enable_io()
        .build()
        .unwrap();

    rt.block_on(future)
    
}