Skip to main content

TaskExt

Trait TaskExt 

Source
pub trait TaskExt: Sized + Task {
    // Provided methods
    fn map<F, R>(self, mapper: F) -> Mapped<Self, F>
       where F: FnOnce(Self::Output) -> R { ... }
    fn with_context(self, context: TaskContext) -> ContextualTask<Self> { ... }
}
Expand description

Extension methods for tasks.

Provided Methods§

Source

fn map<F, R>(self, mapper: F) -> Mapped<Self, F>
where F: FnOnce(Self::Output) -> R,

Transform the output of this task.

Source

fn with_context(self, context: TaskContext) -> ContextualTask<Self>

Convert this task into a task with the given context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> TaskExt for T
where T: Task,