pub(crate) struct Inject<T: 'static> {
shared: Shared<T>,
synced: Mutex<Synced>,
}
Expand description
Growable, MPMC queue used to inject new tasks into the scheduler and as an overflow queue when the local, fixed-size, array queue overflows.
Fields§
§synced: Mutex<Synced>
Implementations§
source§impl<T: 'static> Inject<T>
impl<T: 'static> Inject<T>
pub(crate) fn new() -> Inject<T>
sourcepub(crate) fn close(&self) -> bool
pub(crate) fn close(&self) -> bool
Closes the injection queue, returns true
if the queue is open when the
transition is made.
sourcepub(crate) fn push(&self, task: Notified<T>)
pub(crate) fn push(&self, task: Notified<T>)
Pushes a value into the queue.
This does nothing if the queue is closed.
pub(crate) fn pop(&self) -> Option<Notified<T>>
Auto Trait Implementations§
impl<T> !Freeze for Inject<T>
impl<T> RefUnwindSafe for Inject<T>where
T: RefUnwindSafe,
impl<T> Send for Inject<T>
impl<T> Sync for Inject<T>
impl<T> Unpin for Inject<T>where
T: Unpin,
impl<T> UnwindSafe for Inject<T>where
T: UnwindSafe,
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