RESTinio
Loading...
Searching...
No Matches
restinio::http_field_parsers::try_extract_field_details Namespace Reference

Classes

struct  valid_field_type
struct  valid_field_type< T, restinio::utils::metaprogramming::void_t< std::enable_if_t< std::is_same< expected_t< T, restinio::easy_parser::parse_error_t >, decltype(T::try_parse(std::declval< string_view_t >())) >::value, bool > > >

Typedefs

template<typename Parsed_Field_Type>
using result_variant_t
 Type of a variant to be returned as the result of attempt to parse HTTP-field.

Functions

template<typename Parsed_Field_Type>
result_variant_t< Parsed_Field_Type > try_extract_field_value_from (std::optional< string_view_t > opt_value, string_view_t default_value)

Typedef Documentation

◆ result_variant_t

Initial value:
std::variant<
Parsed_Field_Type,
Information about parsing error.
A special type to be returned in the case if HTTP-field isn't found in a request.

Type of a variant to be returned as the result of attempt to parse HTTP-field.

Since
v.0.6.8

Definition at line 52 of file try_parse_field.hpp.

Function Documentation

◆ try_extract_field_value_from()

template<typename Parsed_Field_Type>
result_variant_t< Parsed_Field_Type > restinio::http_field_parsers::try_extract_field_details::try_extract_field_value_from ( std::optional< string_view_t > opt_value,
string_view_t default_value )
nodiscard

Definition at line 84 of file try_parse_field.hpp.