Struct thread_tree::ThreadTreeCtx[][src]

pub struct ThreadTreeCtx<'a> { /* fields omitted */ }
Expand description

A level-specific handle to the thread tree, that can be used to inject jobs.

See ThreadTree::top() for more information.

Implementations

Return true if this level will parallelize in join (or if we are at the bottom of the tree)

Branch out and run a and b simultaneously and return their results jointly.

Job a runs on the current thread while b runs on the sibling thread; each is passed a lower level of the thread tree. If the bottom of the tree is reached, where no sibling threads are available, both a and b run on the current thread.

If either a or b panics, the panic is propagated here. If both jobs are executing, the panic will not propagate until after both jobs have finished.

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.

Branch out twice and join, running three different jobs

Branches twice on the left side and once on the right. The closure is called with corresponding thread tree context and an index in 0..3 for the job.

Branch out twice and join, running three different jobs

Branches once on the right side and twice on the right. The closure is called with corresponding thread tree context and an index in 0..3 for the job.

Branch out twice and join, running four different jobs.

Branches twice on each side. The closure is called with corresponding thread tree context and an index in 0..4 for the job.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.