ゴミ箱
|
#include <async_result.hpp>
Public Types | |
using | completion_handler_type = typename boost::asio::handler_type< CompletionToken, Signature >::type |
The concrete completion handler type for the specific signature. More... | |
using | return_type = typename boost::asio::async_result< completion_handler_type >::type |
The return type of the initiating function. More... | |
Public Member Functions | |
async_result (completion_handler_type &h) | |
return_type | get () |
Obtain the value to be returned from the initiating function. More... | |
An interface for customising the behaviour of an asynchronous initiation function.
This class is used for determining:
The trait allows the handler and return types to be determined at the point where the specific completion handler signature is known.
This template takes advantage of specializations of both boost::asio::async_result
and boost::asio::handler_type
for user-defined completion token types. The primary template assumes that the CompletionToken is the completion handler.
The example shows how to define an asynchronous initiation function whose completion handler receives an error code:
using boost::beast::async_result< CompletionToken, Signature >::completion_handler_type = typename boost::asio::handler_type< CompletionToken, Signature>::type |
The concrete completion handler type for the specific signature.
using boost::beast::async_result< CompletionToken, Signature >::return_type = typename boost::asio::async_result< completion_handler_type>::type |
The return type of the initiating function.
|
inlineexplicit |
Construct an async result from a given handler.
When using a specalised async_result, the constructor has an opportunity to initialise some state associated with the completion handler, which is then returned from the initiating function.
|
inline |
Obtain the value to be returned from the initiating function.