restinio::easy_parser::impl::as_result_consumer_t Struct Reference

A consumer for the case when the current value should be returned as the result for the producer at one level up. More...

`#include <easy_parser.hpp>`

Inheritance diagram for restinio::easy_parser::impl::as_result_consumer_t:

## Public Member Functions

template<typename Target_Type , typename Value >
void | consume (Target_Type &dest, Value &&src) const

## Additional Inherited Members

Static Public Attributes inherited from restinio::easy_parser::impl::consumer_tag
static constexpr entity_type_t | entity_type = entity_type_t::consumer

## Detailed Description

A consumer for the case when the current value should be returned as the result for the producer at one level up.

For example that consumer can be necessary for rules like that:

     T := 'v' '=' token

such rule will be implemented by a such sequence of clauses:

produce<std::string>(symbol('v'), symbol('='), token_p() >> as_result());
restinio::easy_parser::symbol
RESTINIO_NODISCARD auto symbol(char expected) noexcept
A factory function to create a clause that expects the speficied symbol, extracts it and then skips i...
Definition: easy_parser.hpp:4032
restinio::easy_parser::as_result
RESTINIO_NODISCARD auto as_result() noexcept
A factory function to create a as_result_consumer.
Definition: easy_parser.hpp:4470
restinio::http_field_parsers::token_p
RESTINIO_NODISCARD auto token_p() noexcept
A factory function to create a token_producer.
Definition: basics.hpp:985

The result of `token_p()` producer in a subclause should be returned as the result of top-level producer.

Since
  v.0.6.1

Definition at line 2869 of file easy_parser.hpp.

## Member Function Documentation

## consume()

template<typename Target_Type , typename Value >

void restinio::easy_parser::impl::as_result_consumer_t::consume | ( | Target_Type & | dest,
|  | Value && | src
| ) |  | const

inline

Definition at line 2873 of file easy_parser.hpp.

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

- restinio/helpers/easy_parser.hpp