pub trait IoBackendExt<Handle>: IoBackend<Handle>
where Handle: Pollable,
{ // Provided methods fn with_backend<F>( &self, future: F ) -> (WithBackend<'_, Self::Backend, F>, Option<PollingHandle<'_>>) where F: Future { ... } fn block_on<F>(&self, fut: F) -> <F as Future>::Output where F: Future { ... } }
Available on crate feature test_suite only.
Expand description

Helpers for IoBackend.

Provided Methods§

source

fn with_backend<F>( &self, future: F ) -> (WithBackend<'_, Self::Backend, F>, Option<PollingHandle<'_>>)
where F: Future,

Builds a composite future that also polls the backend future.

If second tuple element is not None, then the caller is responsible for registering and handling read-readiness events.

source

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

Executes a future to completion.

This function uses mfio’s mini-executor that is able to resolve an arbitrary future that is either awoken externally, or through exported handle’s readiness events.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, Handle> IoBackendExt<Handle> for T
where T: IoBackend<Handle> + ?Sized, Handle: Pollable,