pub(crate) struct State {
pub(crate) queue: ConcurrentQueue<Runnable>,
pub(crate) local_queues: RwLock<Vec<Arc<ConcurrentQueue<Runnable>>>>,
pub(crate) notified: AtomicBool,
pub(crate) sleepers: Mutex<Sleepers>,
pub(crate) active: Mutex<Slab<Waker>>,
}Expand description
The state of a executor.
Fields§
§queue: ConcurrentQueue<Runnable>The global queue.
local_queues: RwLock<Vec<Arc<ConcurrentQueue<Runnable>>>>Local queues created by runners.
notified: AtomicBoolSet to true when a sleeping ticker is notified or no tickers are sleeping.
sleepers: Mutex<Sleepers>A list of sleeping tickers.
active: Mutex<Slab<Waker>>Currently active tasks.
Implementations§
Source§impl State
impl State
pub(crate) fn pin(&self) -> Pin<&Self>
Sourcepub(crate) fn active(self: Pin<&Self>) -> MutexGuard<'_, Slab<Waker>>
pub(crate) fn active(self: Pin<&Self>) -> MutexGuard<'_, Slab<Waker>>
Returns a reference to currently active tasks.
pub(crate) fn try_tick(&self) -> bool
pub(crate) async fn tick(&self)
pub async fn run<T>(&self, future: impl Future<Output = T>) -> T
Auto Trait Implementations§
impl !Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more