Enum forkjoin::TaskResult [] [src]

pub enum TaskResult<Arg, Ret> {
    Done(Ret),
    Fork(Vec<Arg>, Option<Ret>),
}

Return values from tasks. Represent a computed value or a fork of the algorithm.

Variants

Done

Return this from TaskFun to indicate a computed value. Represents a leaf in the problem tree of the computation.

If the algorithm style is AlgoStyle::Search the value in Done will be sent directly to the Job held by the submitter of the computation. If the algorithm style is AlgoStyle::Reduce the value in Done will be inserted into a join barrier and later passed to the algorithms join function when all subtasks have completed execution.

Fork

Return this from TaskFun to indicate that the algorithm wants to fork. Takes a list of arguments to fork on. One subtask will be created for each argument. The second value is only used by ReduceStyle::Arg-algorithms to send a value directly to the TaskJoinArg, passing None in such algorithms will yield a panic.