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 {
19using int_type = std::uint64_t;
23 using node_type = basic_node<std::string_view>;
24 using result = std::optional<node_type>;
26 static constexpr std::size_t max_embedded_depth = 5;
27 static constexpr std::string_view sep =
"\r\n";
38 std::array<std::size_t, max_embedded_depth + 1> sizes_;
41 int_type bulk_length_;
48 std::size_t consumed_;
51 auto consume_impl(
type t, std::string_view elem, system::error_code& ec) -> node_type;
53 void commit_elem() noexcept;
58 auto bulk_expected() const noexcept ->
bool
66 auto done() const noexcept ->
bool;
68 auto get_suggested_buffer_growth(std::
size_t hint) const noexcept -> std::
size_t;
70 auto get_consumed() const noexcept -> std::
size_t;
72 auto consume(std::string_view view, system::error_code& ec) noexcept -> result;
80template <class Adapter>
84 std::string_view const& msg,
86 system::error_code& ec)
89 auto const res = p.consume(msg, ec);
96 adapter(res.value(), ec);
system::result< Value, error > result
Stores response to individual Redis commands.