-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Since Rust 2024 edition, We can use async-closures withAsyncFn* traits.
By using this feature, we will be able to write code like the example below.
Reactor::schedule(async move |task|{
});However, the future returned by the closure cannot be made thread-safe, which makes the implementation difficult (it is technically doable if you use an unsafe impl, though).
#[inline(always)]
pub fn schedule<F>(f: F) -> Scheduler<State>
where
F: AsyncFnOnce(CoreTask<State>) + Send + Sync + 'static,
<F as AsyncFnOnce<(CoreTask<State>,)>>::CallOnceFuture: Send + Sync,
---------------------------------------------- expected 1 generic argumentReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request