maycoon_core/tasks/
waker.rs1use std::task::{RawWaker, RawWakerVTable, Waker};
2
3#[inline(always)]
9pub const fn noop_waker() -> Waker {
10 unsafe { Waker::from_raw(noop_raw_waker()) }
11}
12
13#[inline(always)]
15const fn noop_raw_waker() -> RawWaker {
16 RawWaker::new(
17 std::ptr::null(),
18 &RawWakerVTable::new(clone, wake, wake_by_ref, drop),
19 )
20}
21
22#[inline(always)]
24const fn clone(_: *const ()) -> RawWaker {
25 noop_raw_waker()
26}
27
28#[inline(always)]
30const fn wake(_: *const ()) {}
31
32#[inline(always)]
34const fn wake_by_ref(_: *const ()) {}
35
36#[inline(always)]
38const fn drop(_: *const ()) {}