pub trait HealthFutureExt<T>where
    Self: Future<Output = T> + 'static,
    T: 'static,{
    // Required method
    fn block(self) -> T;
}

Required Methods§

source

fn block(self) -> T

Block on the provided future and return the result.

Arguments
  • future - The future to run.
Returns

Returns the return value of the future.

Examples
use libhealth::utils::prelude::*;

assert_eq!(async { 25 }.block(), 25);

Implementors§

source§

impl<F, T> HealthFutureExt<T> for Fwhere F: Future<Output = T> + 'static, T: 'static,