pub struct Queue<'a, T, P = DefaultConPinnedVec<T>>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>) -> Self
fn from(queue: &'a ConcurrentQueue<T, P>) -> Self
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