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>
30 #ifndef SEASTAR_MODULE
38 template <
typename CharType>
43 using char_type = CharType;
50 void append_static(
const char_type* buf,
size_t size) {
57 void append_static(
const char_type(&s)[N]) {
58 append_static(s, N - 1);
61 void append_static(
const char_type* s) {
62 append_static(s, strlen(s));
65 template <
typename size_type,
size_type max_size>
67 append_static(s.begin(), s.size());
70 void append_static(
const std::string_view& s) {
71 append_static(s.data(), s.size());
74 void append(std::string_view v) {
82 _p =
packet(std::move(_p), std::move(buff));
86 template <
typename size_type,
size_type max_size>
89 _p =
packet(std::move(_p), std::move(s).release());
93 template <
typename size_type,
size_type max_size,
typename Callback>
96 _p =
packet(std::move(_p),
fragment{s.begin(), s.size()}, make_deleter(std::move(callback)));
100 void reserve(
int n_frags) {
105 return std::move(_p);
108 template <
typename Callback>
109 void on_delete(Callback callback) {
110 _p =
packet(std::move(_p), make_deleter(std::move(callback)));
113 operator bool()
const {
Definition: sstring.hh:75
Definition: deleter.hh:51
Definition: scattered_message.hh:39
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