Struct cros_async::queue::RunnableQueue
source · pub struct RunnableQueue {
runnables: Mutex<VecDeque<Runnable>>,
}
Expand description
A queue of Runnables
. Intended to be used by executors to keep track of futures that have been
scheduled to run.
Fields§
§runnables: Mutex<VecDeque<Runnable>>
Implementations§
source§impl RunnableQueue
impl RunnableQueue
sourcepub fn new() -> RunnableQueue
pub fn new() -> RunnableQueue
Create a new, empty RunnableQueue
.
sourcepub fn push_back(&self, runnable: Runnable)
pub fn push_back(&self, runnable: Runnable)
Schedule runnable
to run in the future by adding it to this RunnableQueue
.
sourcepub fn pop_front(&self) -> Option<Runnable>
pub fn pop_front(&self) -> Option<Runnable>
Remove and return the first Runnable
in this RunnableQueue
or None
if it is empty.
sourcepub fn iter(&self) -> RunnableQueueIter<'_> ⓘ
pub fn iter(&self) -> RunnableQueueIter<'_> ⓘ
Create an iterator over this RunnableQueue
that repeatedly calls pop_front()
until it is
empty.
Trait Implementations§
source§impl Default for RunnableQueue
impl Default for RunnableQueue
source§impl<'q> IntoIterator for &'q RunnableQueue
impl<'q> IntoIterator for &'q RunnableQueue
Auto Trait Implementations§
impl RefUnwindSafe for RunnableQueue
impl Send for RunnableQueue
impl Sync for RunnableQueue
impl Unpin for RunnableQueue
impl UnwindSafe for RunnableQueue
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