Skip to main content

InjectQueue

Enum InjectQueue 

Source
pub(crate) enum InjectQueue<T: 'static> {
    Locked(Inject<T>),
}
Expand description

The multi-thread scheduler’s inject queue. Each variant owns its queue and lock topology.

Variants§

§

Locked(Inject<T>)

A single queue behind a single mutex.

Implementations§

Source§

impl<T: 'static> InjectQueue<T>

Source

pub(crate) fn new() -> InjectQueue<T>

Source

pub(crate) fn is_empty(&self) -> bool

Source

pub(crate) fn len(&self) -> usize

Source

pub(crate) fn is_closed(&self) -> bool

Source

pub(crate) fn close(&self) -> bool

Closes the queue, returns true if the queue was open when the transition was made.

Source

pub(crate) fn push(&self, task: Notified<T>)

Pushes a value into the queue.

This does nothing if the queue is closed.

Source

pub(crate) fn pop(&self) -> Option<Notified<T>>

Source

pub(crate) fn push_batch<I>(&self, iter: I)
where I: Iterator<Item = Notified<T>>,

Pushes several values into the queue.

This does nothing if the queue is closed.

Source

pub(crate) fn pop_n<R>(&self, n: usize, f: impl FnOnce(Pop<'_, T>) -> R) -> R

Pops up to n values from the queue, passing an iterator over them to f. Any values f does not consume are removed from the queue and dropped.

Auto Trait Implementations§

§

impl<T> !Freeze for InjectQueue<T>

§

impl<T> RefUnwindSafe for InjectQueue<T>
where T: RefUnwindSafe,

§

impl<T> Send for InjectQueue<T>

§

impl<T> Sync for InjectQueue<T>

§

impl<T> Unpin for InjectQueue<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for InjectQueue<T>

§

impl<T> UnwindSafe for InjectQueue<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.