YOrch 1.0.0
Loading...
Searching...
No Matches
yorch::catch_failure_task< Task > Struct Template Reference

Exception-catching adapter for tasks that rely on the default failure mapping. More...

#include <catch_as_failure.hpp>

Inheritance diagram for yorch::catch_failure_task< Task >:
Collaboration diagram for yorch::catch_failure_task< Task >:

Public Member Functions

constexpr catch_failure_task (Task &&stored_task) noexcept(std::is_nothrow_move_constructible_v< Task >)
 
constexpr catch_failure_task (const Task &stored_task) noexcept(std::is_nothrow_copy_constructible_v< Task >)
 
template<typename Ctx , typename Prev >
requires default_catchable_task<Task, Ctx, Prev>
constexpr auto invoke_raw (exec_context< Ctx, Prev > &ec) noexcept
 Executes the wrapped task and maps thrown exceptions to failure.
 
template<typename Ctx , typename Prev , typename U = Task>
requires direct_output_task<U, Ctx, Prev>
constexpr step_result invoke_into (exec_context< Ctx, Prev > &ec, direct_out< detail::declared_task_output_t< U > > out) noexcept
 

Public Attributes

Task task
 

Detailed Description

template<typename Task>
struct yorch::catch_failure_task< Task >

Exception-catching adapter for tasks that rely on the default failure mapping.

The wrapped task itself may throw. This adapter catches any exception, converts it into a compatible failure raw result, and exposes a noexcept invoke_raw(...) protocol to the outer executor.

Template Parameters
TaskStored task type.

Definition at line 19 of file catch_as_failure.hpp.

Constructor & Destructor Documentation

◆ catch_failure_task() [1/2]

template<typename Task >
constexpr yorch::catch_failure_task< Task >::catch_failure_task ( Task &&  stored_task)
inlineexplicitconstexprnoexcept

Definition at line 25 of file catch_as_failure.hpp.

◆ catch_failure_task() [2/2]

template<typename Task >
constexpr yorch::catch_failure_task< Task >::catch_failure_task ( const Task &  stored_task)
inlineexplicitconstexprnoexcept

Definition at line 29 of file catch_as_failure.hpp.

Member Function Documentation

◆ invoke_into()

template<typename Task >
template<typename Ctx , typename Prev , typename U = Task>
requires direct_output_task<U, Ctx, Prev>
constexpr step_result yorch::catch_failure_task< Task >::invoke_into ( exec_context< Ctx, Prev > &  ec,
direct_out< detail::declared_task_output_t< U > >  out 
)
inlineconstexprnoexcept

Definition at line 66 of file catch_as_failure.hpp.

◆ invoke_raw()

template<typename Task >
template<typename Ctx , typename Prev >
requires default_catchable_task<Task, Ctx, Prev>
constexpr auto yorch::catch_failure_task< Task >::invoke_raw ( exec_context< Ctx, Prev > &  ec)
inlineconstexprnoexcept

Executes the wrapped task and maps thrown exceptions to failure.

Template Parameters
CtxContext schema.
PrevDirect-parent slot view type.
Parameters
ecBorrowed execution context.
Returns
The wrapped task's raw result on success, or a synthesized failure result on exception.

Definition at line 44 of file catch_as_failure.hpp.

Member Data Documentation

◆ task

template<typename Task >
Task yorch::catch_failure_task< Task >::task

Definition at line 23 of file catch_as_failure.hpp.


The documentation for this struct was generated from the following file: