tycho-util 0.3.9

Shared utilities for node components.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
pub trait AwaitBlocking: IntoFuture {
    /// Blocks the current thread polling the future to completion.
    ///
    /// DO NOT USE INSIDE ASYNC CONTEXT.
    fn await_blocking(self) -> <Self as IntoFuture>::Output;
}

impl<T: IntoFuture> AwaitBlocking for T {
    fn await_blocking(self) -> <Self as IntoFuture>::Output {
        futures_executor::block_on(self.into_future())
    }
}