Skip to main content

BlockOnFuture

Trait BlockOnFuture 

Source
pub trait BlockOnFuture {
    type Output;

    // Required method
    fn block(self) -> Self::Output;
}
Expand description

Marker trait to block on futures in synchronous code.

This is a simple convenience. Many of the tests in this crate render something and then read a texture in order to perform a diff on the result using a known image. Since reading from the GPU is async, this trait helps cut down boilerplate.

Required Associated Types§

Required Methods§

Source

fn block(self) -> Self::Output

Block on the future using [futures_util::future::block_on].

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Future> BlockOnFuture for T

Available on cpu and (crate features test-utils) only.