tokio/runtime/scheduler/multi_thread/
overflow.rs

1use crate::runtime::task;
2
3#[cfg(test)]
4use std::cell::RefCell;
5
6pub(crate) trait Overflow<T: 'static> {
7    fn push(&self, task: task::Notified<T>);
8
9    fn push_batch<I>(&self, iter: I)
10    where
11        I: Iterator<Item = task::Notified<T>>;
12}
13
14#[cfg(test)]
15impl<T: 'static> Overflow<T> for RefCell<Vec<task::Notified<T>>> {
16    fn push(&self, task: task::Notified<T>) {
17        self.borrow_mut().push(task);
18    }
19
20    fn push_batch<I>(&self, iter: I)
21    where
22        I: Iterator<Item = task::Notified<T>>,
23    {
24        self.borrow_mut().extend(iter);
25    }
26}