Encoder and decoder for top-level Quack protocol messages.
This module converts between message structs and wire-format binaries. It is kept independent from HTTP, DBConnection, and public client APIs so protocol compatibility can be tested in isolation.
Summary
Types
@type decoded_message() :: {QuackDB.Protocol.Message.Header.t(), struct()}
Functions
@spec decode(binary()) :: {:ok, decoded_message()} | {:error, QuackDB.Error.t()}
@spec decode_header(binary()) :: QuackDB.Protocol.Reader.read_result(QuackDB.Protocol.Message.Header.t())
@spec encode_header(QuackDB.Protocol.Message.Header.t()) :: iodata()