boost::redis::resp3::boost_redis_to_bulk

Adds a bulk to the request.

Synopsis

void
boost_redis_to_bulk(
    std::string& payload,
    std::string_view data);

Description

This function is useful in serialization of your own data structures in a request. For example

void boost_redis_to_bulk(std::string& payload, mystruct const& obj)
{
   auto const str = // Convert obj to a string.
   boost_redis_to_bulk(payload, str);
}

The function must add exactly one bulk string RESP3 node. If you're using boost_redis_to_bulk with a string argument, you're safe.

Parameters

Name Description

payload

Storage on which data will be copied into.

data

Data that will be serialized and stored in payload.

Created with MrDocs