Skip to main content

TaskExt

Trait TaskExt 

Source
pub trait TaskExt<T, E> {
    // Required methods
    fn detach_and_log_err(self, cx: &App);
    fn detach_and_log_err_with_backtrace(self, cx: &App);
}
Expand description

Extension trait for Task<Result<T, E>> that adds detach_and_log_err with an &App context.

This trait is automatically implemented for all Task<Result<T, E>> types.

Required Methods§

Source

fn detach_and_log_err(self, cx: &App)

Run the task to completion in the background and log any errors that occur.

Source

fn detach_and_log_err_with_backtrace(self, cx: &App)

Like Self::detach_and_log_err, but uses {:?} formatting on failure so anyhow::Error values emit their full backtrace. Prefer detach_and_log_err unless a backtrace is wanted.

Implementors§

Source§

impl<T, E> TaskExt<T, E> for Task<Result<T, E>>
where T: 'static, E: 'static + Display + Debug,