pub struct Wrapper<I>{ /* private fields */ }Expand description
Wrapper for an item
This is used to pass items through parallel iterators. When the wrapper is
dropped, we decrement the processing counter and notify the dispatcher
thread through the item_done_tx channel.
Implementations§
Source§impl<I> Wrapper<I>
impl<I> Wrapper<I>
Sourcepub fn new(inner: I, counter: Arc<AtomicUsize>, item_done_tx: Sender<I>) -> Self
pub fn new(inner: I, counter: Arc<AtomicUsize>, item_done_tx: Sender<I>) -> Self
Create a new Wrapper item
This needs a reference to the processing counter to keep count of the number of items currently processed (used to check for circular dependencies) and the item done channel to notify the dispatcher thread.
Upon creating of a Wrapper, we also increment the processing counter.
Trait Implementations§
Source§impl<I> Deref for Wrapper<I>
Dereference implementation to access the inner item
impl<I> Deref for Wrapper<I>
Dereference implementation to access the inner item
This allow accessing the item using (*wrapper).
Source§impl<I> DerefMut for Wrapper<I>
Dereference implementation to access the inner item
impl<I> DerefMut for Wrapper<I>
Dereference implementation to access the inner item
This allow accessing the item using (*wrapper).
Source§impl<I> Drop for Wrapper<I>
Drop implementation to decrement the processing counter and notify the
dispatcher thread.
impl<I> Drop for Wrapper<I>
Drop implementation to decrement the processing counter and notify the dispatcher thread.
impl<I> Eq for Wrapper<I>
Auto Trait Implementations§
impl<I> Freeze for Wrapper<I>where
I: Freeze,
impl<I> RefUnwindSafe for Wrapper<I>where
I: RefUnwindSafe,
impl<I> Send for Wrapper<I>
impl<I> Sync for Wrapper<I>
impl<I> Unpin for Wrapper<I>where
I: Unpin,
impl<I> UnwindSafe for Wrapper<I>where
I: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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