diesel_async::async_connection_wrapper

Trait BlockOn

Source
pub trait BlockOn {
    // Required methods
    fn block_on<F>(&self, f: F) -> F::Output
       where F: Future;
    fn get_runtime() -> Self;
}
Available on crate feature async-connection-wrapper only.
Expand description

This is a helper trait that allows to customize the async runtime used to execute futures as part of the AsyncConnectionWrapper type. By default a tokio runtime is used.

Required Methods§

Source

fn block_on<F>(&self, f: F) -> F::Output
where F: Future,

This function should allow to execute a given future to get the result

Source

fn get_runtime() -> Self

This function should be used to construct a new runtime instance

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§