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§
sourcefn block_on<F>(&self, f: F) -> F::Outputwhere
F: Future,
fn block_on<F>(&self, f: F) -> F::Outputwhere F: Future,
This function should allow to execute a given future to get the result
sourcefn get_runtime() -> Self
fn get_runtime() -> Self
This function should be used to construct a new runtime instance