Default implementation for the ModeWrapper trait that combines ModeCombiners by
setting the current ModeCombiner as the outer ModeCombiner of the newly added ModeCombiner
so that the iterator walks the ModeCombiners in the reverse order of which they were added, meaning
the ModeCombiner that was added first ends up wrapping the task last, meaning its task will be the
outermost task.
Trait that may be implemented for types that manage executing a task that do not care about
the return type of the task. Implementors may simply override pre_invoke
and post_invoke to run code before or / and after
invoking a task or override do_invoke to control
exactly how a task is invoked, by default this simply calls the task if no mode was supplied
or calls crate::invoke if a mode was supplied.
Trait used to combine ModeWrappers by allowing one ModeWrapper to
delegate to another ModeWrapper and providing an iterator that can unwrap combined ModeWrappers.
An implementation of this trait is returned by ModeWrapper::into_combiner
which returns a DelegatingModeCombiner by default.
Trait to implement in order to apply a mode to a task. ModeWrappers are supplied to a Mode
using Mode::with where they might be combined with other ModeWrappers
using the ModeCombiner supplied by ModeWrapper::into_combiner.
Unlike Invokers, Modes and ModeWrappers are generic over the return type
of the tasks they may wrap and thus can directly interact with the return value of the task.
This also means that the lifetime of the Mode is tied to the lifetime of the type they are generic over.