QuackDB.Protocol.Writer (quackdb v0.1.0)

Copy Markdown View Source

Binary writer primitives for the Quack wire format.

Builds field-tagged objects and scalar encodings used by message codecs while returning iodata so callers can avoid unnecessary binary copies.

Summary

Functions

blob(value)

@spec blob(binary()) :: iodata()

bool(bool)

@spec bool(boolean()) :: <<_::8>>

end_object()

@spec end_object() :: <<_::16>>

field(field_id, value)

@spec field(non_neg_integer(), iodata()) :: iodata()

hugeint(value)

@spec hugeint(integer()) :: iodata()

list(values, write_element)

@spec list([value], (value -> iodata())) :: iodata() when value: term()

nullable(value, write_value)

@spec nullable(value | nil, (value -> iodata())) :: iodata() when value: term()

optional_index(value)

@spec optional_index(non_neg_integer() | nil) :: iodata()

sleb128(value)

@spec sleb128(integer()) :: iodata()

string(value)

@spec string(String.t()) :: iodata()

uleb128(value)

@spec uleb128(non_neg_integer()) :: iodata()