AwaitSync

Trait AwaitSync 

Source
pub trait AwaitSync: Future + Sized {
    // Provided methods
    fn await_sync(self) -> Self::Output { ... }
    fn await_sync_safe(
        self,
    ) -> Result<Self::Output, Box<dyn Any + Send + 'static>> { ... }
}

Provided Methods§

Source

fn await_sync(self) -> Self::Output

Poll a future to completion, blocking the current thread until it is done.

Source

fn await_sync_safe(self) -> Result<Self::Output, Box<dyn Any + Send + 'static>>

Poll a future to completion, blocking the current thread until it is done, returning Err is the thread panics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Future> AwaitSync for F