commit
ca04975d54
62 files changed
+3381
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <expected>
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace vls {
|
||||
|
||||
struct FrameLimits {
|
||||
std::size_t header_bytes{8192};
|
||||
std::size_t body_bytes{16777216};
|
||||
};
|
||||
|
||||
// A disengaged optional means EOF between frames. Framing errors are fatal: the
|
||||
// caller must not attempt to find another frame in an untrusted byte stream.
|
||||
[[nodiscard]] std::expected<std::optional<std::string>, std::string>
|
||||
read_frame(std::istream &input, FrameLimits limits = {});
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string> write_frame(std::ostream &output,
|
||||
std::string_view body);
|
||||
|
||||
} // namespace vls
|
||||
Reference in new issue
Block a user