Debian Codegraph @

third_party/rust/hyper/src/common/task.rs

raw
1 #[cfg(feature = "http1")]
2 use super::Never;
3 pub(crate) use std::task::{Context, Poll};
4
5 /// A function to help "yield" a future, such that it is re-scheduled immediately.
6 ///
7 /// Useful for spin counts, so a future doesn't hog too much time.
8 #[cfg(feature = "http1")]
9 pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll<Never> {
10 cx.waker().wake_by_ref();
11 Poll::Pending
12 }