Class WritePayload (2.21.0)

An opaque representation of the data for an object payload.

Constructors

WritePayload()

Creates an empty payload.

WritePayload(std::string)

Creates a payload from p.

Parameter
NameDescription
p std::string

WritePayload(std::vector< T >)

Creates a payload from p.

Parameters
NameDescription
p std::vector< T >

the resulting object takes ownership of the data in p.

typename T

must be either:

  • char, or
  • std::byte, or
  • an integer type that is exactly 8-bits wide (such as std::int8_t), or
  • std::string, or
  • std::vector<U>, where U is char, std::byte, or or an integer type that is exactly 8-bits wide

Functions

empty() const

Returns true if the payload has no data.

Returns
TypeDescription
bool

size() const

Returns the total size of the data.

Returns
TypeDescription
std::size_t

payload() const

Returns views into the data.

Note that changing *this in any way (assignment, destruction, etc.) invalidates all the returned buffers.

Returns
TypeDescription
std::vector< absl::string_view >