Struct exec_rs::Mode[][src]

pub struct Mode<'m, T: 'm> { /* fields omitted */ }

Struct that manages collecting and combining ModeWrapper. This is the type supplied when submitting tasks in order to apply ModeWrappers.

Modes may be used by implementing the ModeWrapper trait to be able to wrap tasks in an enclosing function. 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.

Implementations

impl<'m, T: 'm> Mode<'m, T>[src]

pub fn new() -> Self[src]

Construct a new empty mode with no ModeCombiner.

This Mode may already be used to invoke tasks with, in which case the Mode will simply be ignored.

pub fn with<M: ModeWrapper<'m, T> + 'm + Send + Sync>(
    self,
    mode_wrapper: M
) -> Self
[src]

Add a new ModeWrapper implementation to this Mode.

This calls the ModeWrapper::into_combiner function of the ModeWrapper and sets the resulting ModeCombiner on this Mode and, if there already is ModeCombiner present, combines the two by calling ModeCombiner::combine on the existing ModeCombiner.

Trait Implementations

impl<'m, T: 'm> Default for Mode<'m, T>[src]

Auto Trait Implementations

impl<'m, T> !RefUnwindSafe for Mode<'m, T>

impl<'m, T> Send for Mode<'m, T>

impl<'m, T> Sync for Mode<'m, T>

impl<'m, T> Unpin for Mode<'m, T>

impl<'m, T> !UnwindSafe for Mode<'m, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.