7#ifndef BOOST_REDIS_RESP3_PARSER_HPP
8#define BOOST_REDIS_RESP3_PARSER_HPP
10#include <boost/redis/resp3/node.hpp>
11#include <boost/system/error_code.hpp>
17namespace boost::redis::resp3 {
21 using node_type = basic_node<std::string_view>;
22 using result = std::optional<node_type>;
24 static constexpr std::size_t max_embedded_depth = 5;
25 static constexpr std::string_view sep =
"\r\n";
36 std::array<std::size_t, max_embedded_depth + 1> sizes_;
39 std::size_t bulk_length_;
46 std::size_t consumed_;
49 auto consume_impl(
type t, std::string_view elem, system::error_code& ec) -> node_type;
51 void commit_elem() noexcept;
56 auto bulk_expected() const noexcept ->
bool
64 auto done() const noexcept ->
bool;
66 auto get_suggested_buffer_growth(std::
size_t hint) const noexcept -> std::
size_t;
68 auto get_consumed() const noexcept -> std::
size_t;
70 auto consume(std::string_view view, system::error_code& ec) noexcept -> result;
78template <class Adapter>
82 std::string_view const& msg,
84 system::error_code& ec)
87 auto const res = p.consume(msg, ec);
94 adapter(res.value(), ec);
system::result< Value, error > result
Stores response to individual Redis commands.