Function allochronic_util::yield [−][src]
pub const fn yield() -> Yieldⓘ
Yields to the executor once.
Examples
use std::task::Poll; use allochronic_util::{poll, r#yield}; let mut future = async { r#yield().await; 1 }; futures_util::pin_mut!(future); assert_eq!(Poll::Pending, poll(&mut future).await); assert_eq!(Poll::Ready(1), poll(future).await);