[−][src]Struct thread_tree::ThreadTreeCtx
A level-specific handle to the thread tree, that can be used to inject jobs.
See ThreadTree::top()
for more information.
Implementations
impl<'_> ThreadTreeCtx<'_>
[src]
pub fn is_parallel(&self) -> bool
[src]
Return true if this level will parallelize in join (or if we are at the bottom of the tree)
pub fn join<A, B, RA, RB>(&self, a: A, b: B) -> (RA, RB) where
A: FnOnce(ThreadTreeCtx<'_>) -> RA + Send,
B: FnOnce(ThreadTreeCtx<'_>) -> RB + Send,
RA: Send,
RB: Send,
[src]
A: FnOnce(ThreadTreeCtx<'_>) -> RA + Send,
B: FnOnce(ThreadTreeCtx<'_>) -> RB + Send,
RA: Send,
RB: Send,
Run a and b simultaneously (and return their results, if applicable).
A runs on the current thread while b runs on the sibling thread; each is passed a lower level of the thread tree (if applicable, or a stub if the bottom is reached).
Warning: functions that execute on worker threads here must not panic (it will abort on panic). Out of a and b, at most one will execute on a worker thread from here, and at least one (or both) will execute on the current thread.
Warning: You must not .join() into the same tree from nested jobs. Nested jobs must be spawned using the context that each job receives as the first parameter.
Trait Implementations
impl<'a> Clone for ThreadTreeCtx<'a>
[src]
pub fn clone(&self) -> ThreadTreeCtx<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for ThreadTreeCtx<'a>
[src]
impl<'a> Debug for ThreadTreeCtx<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for ThreadTreeCtx<'a>
[src]
impl<'a> !Send for ThreadTreeCtx<'a>
[src]
impl<'a> !Sync for ThreadTreeCtx<'a>
[src]
impl<'a> Unpin for ThreadTreeCtx<'a>
[src]
impl<'a> UnwindSafe for ThreadTreeCtx<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,