Trait async_executors::iface::YieldNow
source · pub trait YieldNow {
// Provided method
fn yield_now(&self) -> YieldNowFut ⓘ { ... }
}
Expand description
Trait indicating that tasks can yield to the executor. This put’s the current task at the back of the schedulers queue, giving other tasks a chance to run.
In practice for most executors this just returns a future that will, the first time it is polled, wake up the waker and then return Pending.
The problem with using the executors native implementation is that they generally return an opaque future we would have to box.
Provided Methods§
sourcefn yield_now(&self) -> YieldNowFut ⓘ
fn yield_now(&self) -> YieldNowFut ⓘ
Await this future in order to yield to the executor.
Implementations on Foreign Types§
impl<T> YieldNow for WithDispatch<T>where T: YieldNow,
Available on crate feature
tracing
only.impl<T> YieldNow for Instrumented<T>where T: YieldNow,
Available on crate feature
tracing
only.