use std::task::{Context, RawWaker, RawWakerVTable, Waker};
pub const fn noop_context() -> Context<'static> {
Context::from_waker(noop_waker())
}
pub const fn noop_waker() -> &'static Waker {
const WAKER: &Waker = &unsafe { Waker::from_raw(RAW_WAKER_NOOP) };
WAKER
}
const RAW_WAKER_NOOP: RawWaker = {
const VTABLE: RawWakerVTable = RawWakerVTable::new(
|_| RAW_WAKER_NOOP,
|_| {},
|_| {},
|_| {},
);
RawWaker::new(std::ptr::null(), &VTABLE)
};