Feature gate: #![feature(noop_waker)]
This is a tracking issue for task::Waker::noop, a way to easily crate task::Wakers that do nothing.
Public API
// core::task
impl Waker {
#[must_use]
pub const fn noop() -> &Waker { /* … */ }
}
Steps / History
Unresolved Questions
- Should we also add
RawWaker::noop()? (I don't think so, I can't think of a use case for it)
- Should we also add
Context::noop()? Depending on the direction Context goes a “noop context” might not even make sense in future.
Should it be an associated constant instead? That would allow for let cx = &mut Context::from_waker(&Waker::NOOP); to work on one line (without additional local variables) which is convenient.
- The return type of
Waker::noop() has now been changed to &Waker.
Feature gate:
#![feature(noop_waker)]This is a tracking issue for
task::Waker::noop, a way to easily cratetask::Wakers that do nothing.Public API
Steps / History
task::Waker::noop#96875Unresolved Questions
RawWaker::noop()? (I don't think so, I can't think of a use case for it)Context::noop()? Depending on the directionContextgoes a “noop context” might not even make sense in future.Should it be an associated constant instead? That would allow forlet cx = &mut Context::from_waker(&Waker::NOOP);to work on one line (without additional local variables) which is convenient.Waker::noop()has now been changed to&Waker.