YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::ResultTrait Struct Reference

Default result trait, describes how async abstractions create and inspect results. More...

#include <result.hpp>

Inheritance diagram for yaclib::ResultTrait:
[legend]

Public Types

template<typename V >
using Result = yaclib::Result< V >
 
using Error = std::exception_ptr
 
template<typename R >
using Value = typename detail::InstantiationType< yaclib::Result, R >::Value
 

Static Public Member Functions

template<typename V , typename... Args>
static YACLIB_INLINE yaclib::Result< V > MakeResult (Args &&... args)
 
template<typename V >
static YACLIB_INLINE bool Ok (const yaclib::Result< V > &r) noexcept
 
template<typename R >
static YACLIB_INLINE decltype(autoGetValue (R &&r) noexcept
 
template<typename R >
static YACLIB_INLINE decltype(autoGetError (R &&r) noexcept
 
template<typename R >
static YACLIB_INLINE decltype(autoGet (R &&r)
 
static YACLIB_INLINE bool IsStop (const std::exception_ptr &error) noexcept
 

Detailed Description

Default result trait, describes how async abstractions create and inspect results.

A custom trait should provide the same interface, its container should be copyable iff V is copyable. MakeResult<V>(StopTag) and MakeResult<V>(std::exception_ptr) must not throw: they are invoked inside noexcept cancellation and teardown paths, a throw there will std::terminate

Definition at line 218 of file result.hpp.

Member Typedef Documentation

◆ Error

using yaclib::ResultTrait::Error = std::exception_ptr

Definition at line 222 of file result.hpp.

◆ Result

Definition at line 220 of file result.hpp.

◆ Value

Member Function Documentation

◆ Get()

template<typename R >
static YACLIB_INLINE decltype(auto) yaclib::ResultTrait::Get ( R &&  r)
inlinestatic

Definition at line 259 of file result.hpp.

References yaclib::MakeContract().

◆ GetError()

template<typename R >
static YACLIB_INLINE decltype(auto) yaclib::ResultTrait::GetError ( R &&  r)
inlinestaticnoexcept

Definition at line 254 of file result.hpp.

References yaclib::MakeContract().

◆ GetValue()

template<typename R >
static YACLIB_INLINE decltype(auto) yaclib::ResultTrait::GetValue ( R &&  r)
inlinestaticnoexcept

Definition at line 249 of file result.hpp.

References yaclib::MakeContract().

◆ IsStop()

static YACLIB_INLINE bool yaclib::ResultTrait::IsStop ( const std::exception_ptr &  error)
inlinestaticnoexcept

Definition at line 263 of file result.hpp.

References yaclib::IsStop().

◆ MakeResult()

template<typename V , typename... Args>
static YACLIB_INLINE yaclib::Result< V > yaclib::ResultTrait::MakeResult ( Args &&...  args)
inlinestatic

Definition at line 228 of file result.hpp.

References yaclib::MakeContract().

◆ Ok()

template<typename V >
static YACLIB_INLINE bool yaclib::ResultTrait::Ok ( const yaclib::Result< V > &  r)
inlinestaticnoexcept

Definition at line 244 of file result.hpp.

References yaclib::MakeContract().


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