pub struct Queue<'a, T, P = <SplitVec<T> as IntoConcurrentPinnedVec<T>>::ConPinnedVec>where
T: Send,
P: ConcurrentPinnedVec<T>,{ /* private fields */ }Expand description
A queue of elements that will be returned by the ConcurrentRecursiveIter.
Note that the concurrent recursive iterator is built on top of the ConcurrentQueue.
Queue is just a wrapper over the concurrent queue, exposing only two methods:
pushto add one task at a time,extendto add multiple tasks with known length together with a single update.
Notice that push is very flexible and makes the pushed element available for iteration
as fast as possible.
On the other hand, extend minimizes the overhead of concurrency.
Implementations§
Source§impl<T, P> Queue<'_, T, P>where
T: Send,
P: ConcurrentPinnedVec<T>,
impl<T, P> Queue<'_, T, P>where
T: Send,
P: ConcurrentPinnedVec<T>,
Sourcepub fn push(&self, element: T)
pub fn push(&self, element: T)
Pushes the element to the iterator, making it available to all threads as fast as possible.
Trait Implementations§
Source§impl<'a, T, P> From<&'a ConcurrentQueue<T, P>> for Queue<'a, T, P>where
T: Send,
P: ConcurrentPinnedVec<T>,
impl<'a, T, P> From<&'a ConcurrentQueue<T, P>> for Queue<'a, T, P>where
T: Send,
P: ConcurrentPinnedVec<T>,
Source§fn from(queue: &'a ConcurrentQueue<T, P>) -> Queue<'a, T, P>
fn from(queue: &'a ConcurrentQueue<T, P>) -> Queue<'a, T, P>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T, P> Freeze for Queue<'a, T, P>
impl<'a, T, P> RefUnwindSafe for Queue<'a, T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, P> Send for Queue<'a, T, P>
impl<'a, T, P> Sync for Queue<'a, T, P>
impl<'a, T, P> Unpin for Queue<'a, T, P>
impl<'a, T, P> UnwindSafe for Queue<'a, T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more