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
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.