restinio::details::autodetect_request_handler_type Struct Reference

A special type to be used as indicator that the type of a request handler should be automatically detected. More...

`#include <traits.hpp>`

## Detailed Description

A special type to be used as indicator that the type of a request handler should be automatically detected.

In versions prior to 0.6.13 request-handlers in RESTinio have the same format. But since v.0.6.13 the actual type of request-handler is dependent on extra-data-factory type. It means that if a user defines own extra-data-factory for server's traits then user also has to define own request-handler type:

struct my_extra_data_factory {...};
struct my_traits : public restinio::default_traits_t {
using extra_data_factory_t = my_extra_data_factory;
using request_handler_t = std::function<
restinio::request_handling_status_t(
restinio::generic_request_handle_t<
my_extra_data_factory::data_t>)
>;
};
restinio::generic_request_handle_t
std::shared_ptr< generic_request_t< Extra_Data > > generic_request_handle_t
An alias for shared-pointer to incoming request.
Definition: request_handler.hpp:447
restinio::request_handling_status_t
request_handling_status_t
Request handling status.
Definition: common_types.hpp:26
restinio::traits_t
Definition: traits.hpp:147

But this is a boring and error-prone task. So RESTinio allows a user to specify only `extra_data_factory_t` type and skip the definition of `request_handler_t`. That definition will be performed automatically.

The actual detection of request-handler type is performed by using specialization of actual_request_handler_type_detector for autodetect_request_handler_type.

Since
  v.0.6.13

Definition at line 92 of file traits.hpp.

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

- restinio/traits.hpp