View all comments
Feature gate: #![feature(local_waker)]
This is a tracking issue for support for local wakers on Context. This allows libraries to hold non thread safe data on their wakers, guaranteeing at compile time that the wakers will not be sent across threads. It includes a ContextBuilder type for building contexts.
Public API
impl Context {
fn local_waker(&self) -> &LocalWaker;
}
impl<'a> ContextBuilder<'a> {
fn from_waker(waker: &'a Waker) -> ContextBuilder<'a>;
fn waker(self, waker: &'a Waker) -> ContextBuilder<'a>;
fn local_waker(self, local_waker: &'a LocalWaker,) -> ContextBuilder<'a>
fn build(self) -> Context;
}
impl From<&mut Context> for ContextBuilder;
pub trait LocalWake {
fn wake(self: Rc<Self>);
}
Steps / History
Unresolved Questions
- Should runtimes be allowed to not define a waker?
Relevant links
View all comments
Feature gate:
#![feature(local_waker)]This is a tracking issue for support for local wakers on
Context. This allows libraries to hold non thread safe data on their wakers, guaranteeing at compile time that the wakers will not be sent across threads. It includes aContextBuildertype for building contexts.Public API
Steps / History
Unresolved Questions
Relevant links
Sync#66481Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩