util/*FifoBuffer: migrate from WritableBuffer to std::span
This commit is contained in:

committed by
Max Kellermann

parent
570755f05a
commit
bb7be9a4cd
@@ -53,13 +53,13 @@ Response::VFmt(fmt::string_view format_str, fmt::format_args args) noexcept
|
||||
}
|
||||
|
||||
bool
|
||||
Response::WriteBinary(ConstBuffer<void> payload) noexcept
|
||||
Response::WriteBinary(std::span<const std::byte> payload) noexcept
|
||||
{
|
||||
assert(payload.size <= client.binary_limit);
|
||||
assert(payload.size() <= client.binary_limit);
|
||||
|
||||
return
|
||||
Fmt("binary: {}\n", payload.size) &&
|
||||
Write(payload.data, payload.size) &&
|
||||
Fmt("binary: {}\n", payload.size()) &&
|
||||
Write(payload.data(), payload.size()) &&
|
||||
Write("\n");
|
||||
}
|
||||
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <span>
|
||||
|
||||
template<typename T> struct ConstBuffer;
|
||||
class Client;
|
||||
class TagMask;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
bool WriteBinary(ConstBuffer<void> payload) noexcept;
|
||||
bool WriteBinary(std::span<const std::byte> payload) noexcept;
|
||||
|
||||
void Error(enum ack code, const char *msg) noexcept;
|
||||
|
||||
|
Reference in New Issue
Block a user