pub struct WorkerController<F, V, T, I>where
F: Fn(V) -> T + Send + Sync,
V: Send + Sync,
T: Send + Sync,
I: AtomicIterator<AtomicItem = V> + Send + Sized,{ /* private fields */ }Implementations§
Source§impl<F, V, T, I> WorkerController<F, V, T, I>
impl<F, V, T, I> WorkerController<F, V, T, I>
pub fn new(f: F, values: I) -> Self
pub fn set_max_threads(&mut self, limit: usize)
Sourcepub fn run<C>(&mut self) -> Result<C, WorkThreadError>where
C: Collector<T>,
pub fn run<C>(&mut self) -> Result<C, WorkThreadError>where
C: Collector<T>,
run function is usually called after WorkerController is instantiated. It is responsible for running the three processes: generate threads and pull from primary queue, redistribute and conquer work amongst threads and join for closure
Auto Trait Implementations§
impl<F, V, T, I> Freeze for WorkerController<F, V, T, I>where
I: Freeze,
impl<F, V, T, I> RefUnwindSafe for WorkerController<F, V, T, I>where
I: RefUnwindSafe,
impl<F, V, T, I> Send for WorkerController<F, V, T, I>
impl<F, V, T, I> Sync for WorkerController<F, V, T, I>where
I: Sync,
impl<F, V, T, I> Unpin for WorkerController<F, V, T, I>where
I: Unpin,
impl<F, V, T, I> UnwindSafe for WorkerController<F, V, T, 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
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.