Skip to main content

IntoTaskHandlerResult

Trait IntoTaskHandlerResult 

Source
pub trait IntoTaskHandlerResult {
    // Required method
    fn into_task_handler_result(self) -> Result<(), impl Debug>;
}
Expand description

Trait for converting task handler return types into a standardized Result.

This trait allows task handlers to return different types while maintaining a consistent interface. It enables task handlers to return:

  • () (unit type) for successful execution with no return value
  • Result<(), E> for success/failure with error type E

The trait converts these different return types into a standardized Result<(), impl Debug>.

Required Methods§

Source

fn into_task_handler_result(self) -> Result<(), impl Debug>

Converts the implementing type into a task handler result.

§Returns

A Result<(), impl Debug> where:

  • Ok(()) represents successful task execution
  • Err(e) represents task failure with a debug-printable error

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoTaskHandlerResult for ()

Implementation for the unit type, allowing tasks to simply return ().

Source§

impl<D: Debug> IntoTaskHandlerResult for Result<(), D>

Implementation for Result types, allowing tasks to return errors directly.

Implementors§