externally-driven-async-rt 0.4.0

Async runtime that is meant to be embedded
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::{cell::Cell, marker::PhantomData};

#[derive(Clone, Copy)]
#[must_use]
pub(crate) struct Claimed<'a>(PhantomData<(Cell<&'a ()>, *const ())>);

impl Claimed<'_> {
    /// # Safety
    ///
    /// Every task spawned with the returned `Claimed` must be polled and dropped only before `'a`
    /// ends.
    pub(crate) const unsafe fn new() -> Self {
        Self(PhantomData)
    }
}