24#include <seastar/core/deleter.hh>
25#include <seastar/core/temporary_buffer.hh>
26#include <seastar/net/packet.hh>
27#include <seastar/core/sstring.hh>
28#include <seastar/util/std-compat.hh>
29#include <seastar/util/modules.hh>
34template <
typename CharType>
39 using char_type = CharType;
46 void append_static(
const char_type* buf,
size_t size) {
53 void append_static(
const char_type(&s)[N]) {
54 append_static(s, N - 1);
57 void append_static(
const char_type* s) {
58 append_static(s, strlen(s));
61 template <
typename size_type,
size_type max_size>
63 append_static(s.begin(), s.size());
66 void append_static(
const std::string_view& s) {
67 append_static(s.data(), s.size());
70 void append(std::string_view v) {
78 _p =
packet(std::move(_p), std::move(buff));
82 template <
typename size_type,
size_type max_size>
85 _p =
packet(std::move(_p), std::move(s).release());
89 template <
typename size_type,
size_type max_size,
typename Callback>
92 _p =
packet(std::move(_p),
fragment{s.begin(), s.size()}, make_deleter(std::move(callback)));
96 void reserve(
int n_frags) {
101 return std::move(_p);
104 template <
typename Callback>
105 void on_delete(Callback callback) {
106 _p =
packet(std::move(_p), make_deleter(std::move(callback)));
109 operator bool()
const {
Definition: sstring.hh:76
Definition: deleter.hh:52
Definition: scattered_message.hh:35
Definition: temporary_buffer.hh:67
size_t size() const noexcept
Gets the buffer size.
Definition: temporary_buffer.hh:130
Seastar API namespace.
Definition: abort_on_ebadf.hh:26