devela::work

Trait ExtFuture

Source
pub trait ExtFuture: Future {
    // Provided method
    fn block_on(self) -> Self::Output
       where Self: Sized { ... }
}
Expand description

Extension trait providing additional methods for Futures.

Provided Methods§

Source

fn block_on(self) -> Self::Output
where Self: Sized,

Available on crate feature std only.

Blocks the thread until the future is ready.

See also the future_block function.

§Example
use devela::ExtFuture as _;

let future = async {};
let result = future.block_on();

Implementors§

Source§

impl<F: Future> ExtFuture for F