171 bool operator<<(
const Bytes& bytes)
noexcept;
183 bool operator>>(Bytes& bytes)
const noexcept;
196 [[nodiscard]]
static bool check_valid(
const Bytes& bytes)
noexcept;
206 [[nodiscard]]
size_t get_serialized_size()
const noexcept;
213 [[nodiscard]]
bool is_valid()
const noexcept;
226 bool shallow_copy(
const RawData& target)
noexcept;
239 bool deep_copy(
const RawData& target)
noexcept;
251 bool move_copy(
RawData& target)
noexcept;
263 bool create(
size_t size)
noexcept;
272 void clear()
noexcept;
287 bool shallow_copy(uint8_t* data,
size_t size)
noexcept;
300 bool deep_copy(uint8_t* data,
size_t size)
noexcept;
309 bool fill_data(uint8_t* data,
size_t size)
noexcept;
320 [[nodiscard]] uint16_t& reserved_buf()
noexcept;
327 [[nodiscard]]
const uint8_t* data()
const noexcept;
334 [[nodiscard]]
size_t size()
const noexcept;
345 [[nodiscard]]
bool is_owner()
const noexcept;
349 static constexpr bool kZerocopyTypes{
true};
352 uint8_t* data_{
nullptr};
354 bool is_owner_{
false};
355 uint16_t reserved_buf_{0};
357 static constexpr uint32_t kMagicNumberBegin{0x98B7F11A};
358 static constexpr uint32_t kMagicNumberEnd{0x98B7F11F};
Versatile byte buffer with small-buffer optimisation, ownership semantics and compression.
#define VLINK_EXPORT_AND_ALIGNED(align_num)
Marks a class or variable as both exported and aligned to the given byte boundary.
定义 macros.h:103
Generic zero-copy raw-byte data container with Header metadata.